public class CoreListener extends Object implements NatsMessageListener
| Constructor and Description |
|---|
CoreListener(String subject,
NatsInjectHandler injectHandler,
Properties natsProperties) |
| Modifier and Type | Method and Description |
|---|---|
void |
closeConnection()
Close the connection to NATS server and set connection to null.
|
boolean |
createConnection()
Create the connection to the Core NATS server.
|
io.nats.client.Connection |
getNatsConnection()
Create and return the Core NATS connection.
|
void |
initializeConsumer(String sequenceName)
Consume the message received and inject into the sequence.
|
public CoreListener(String subject, NatsInjectHandler injectHandler, Properties natsProperties)
public boolean createConnection()
throws IOException,
InterruptedException
createConnection in interface NatsMessageListenerIOExceptionInterruptedExceptionpublic io.nats.client.Connection getNatsConnection()
throws IOException,
InterruptedException
IOExceptionInterruptedExceptionpublic void initializeConsumer(String sequenceName) throws IOException, InterruptedException
initializeConsumer in interface NatsMessageListenersequenceName - the sequence to inject the message to.IOExceptionInterruptedExceptionpublic void closeConnection()
closeConnection in interface NatsMessageListenerCopyright © 2021 WSO2. All rights reserved.