Class CoreListener
java.lang.Object
org.wso2.carbon.inbound.endpoint.protocol.nats.CoreListener
- All Implemented Interfaces:
NatsMessageListener
Core listener class which uses core NATS connection to receive messages.
-
Constructor Summary
ConstructorsConstructorDescriptionCoreListener(String subject, NatsInjectHandler injectHandler, Properties natsProperties) -
Method Summary
Modifier and TypeMethodDescriptionvoidClose the connection to NATS server and set connection to null.booleanCreate the connection to the Core NATS server.io.nats.client.ConnectionCreate and return the Core NATS connection.voidinitializeConsumer(String sequenceName) Consume the message received and inject into the sequence.
-
Constructor Details
-
CoreListener
-
-
Method Details
-
createConnection
Create the connection to the Core NATS server.- Specified by:
createConnectionin interfaceNatsMessageListener- Returns:
- boolean value whether connection is created.
- Throws:
IOExceptionInterruptedException
-
getNatsConnection
Create and return the Core NATS connection.- Returns:
- the Core NATS connection.
- Throws:
IOExceptionInterruptedException
-
initializeConsumer
Consume the message received and inject into the sequence.- Specified by:
initializeConsumerin interfaceNatsMessageListener- Parameters:
sequenceName- the sequence to inject the message to.- Throws:
IOExceptionInterruptedException
-
closeConnection
public void closeConnection()Close the connection to NATS server and set connection to null.- Specified by:
closeConnectionin interfaceNatsMessageListener
-