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 void
closeConnection()
void
initializeConsumer()
Create the NATS connection and poll messages.void
initializeMessageListener()
Initialize the message listener to use (Core NATS or NATS Streaming).void
registerHandler(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, TimeoutException
Create 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
-
-