Class NatsMessageConsumer
- java.lang.Object
-
- org.wso2.carbon.inbound.endpoint.protocol.nats.NatsMessageConsumer
-
public class NatsMessageConsumer extends Object
Message consumer for NATS to initialize connection and listen for messages.
-
-
Constructor Summary
Constructors Constructor Description NatsMessageConsumer(Properties natsProperties, String inboundEndpointName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseConnection()voidinitializeConsumer()Create the NATS connection and poll messages.voidinitializeMessageListener()Initialize the message listener to use (Core NATS or NATS Streaming).voidregisterHandler(NatsInjectHandler injectHandler)Register a handler to implement injection of the retrieved message.
-
-
-
Constructor Detail
-
NatsMessageConsumer
public NatsMessageConsumer(Properties natsProperties, String inboundEndpointName)
-
-
Method Detail
-
initializeMessageListener
public void initializeMessageListener()
Initialize the message listener to use (Core NATS or NATS Streaming).
-
initializeConsumer
public void initializeConsumer() throws IOException, InterruptedException, TimeoutExceptionCreate the NATS connection and poll messages.
-
closeConnection
public void closeConnection()
-
registerHandler
public void registerHandler(NatsInjectHandler injectHandler)
Register a handler to implement injection of the retrieved message.- Parameters:
injectHandler- the injectHandler
-
-