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 NatsMessageListener
IOException
InterruptedException
public io.nats.client.Connection getNatsConnection() throws IOException, InterruptedException
IOException
InterruptedException
public void initializeConsumer(String sequenceName) throws IOException, InterruptedException
initializeConsumer
in interface NatsMessageListener
sequenceName
- the sequence to inject the message to.IOException
InterruptedException
public void closeConnection()
closeConnection
in interface NatsMessageListener
Copyright © 2020 WSO2. All rights reserved.