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 Details

    • NatsMessageConsumer

      public NatsMessageConsumer(Properties natsProperties, String inboundEndpointName)
  • Method Details

    • 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.
      Throws:
      IOException
      InterruptedException
      TimeoutException
    • closeConnection

      public void closeConnection()
    • registerHandler

      public void registerHandler(NatsInjectHandler injectHandler)
      Register a handler to implement injection of the retrieved message.
      Parameters:
      injectHandler - the injectHandler