public class StreamingListener extends Object implements NatsMessageListener
Constructor and Description |
---|
StreamingListener(String subject,
NatsInjectHandler injectHandler,
Properties natsProperties) |
Modifier and Type | Method and Description |
---|---|
void |
closeConnection()
Close the connection to NATS Streaming server and set connection to null.
|
boolean |
createConnection()
Create the connection to the NATS Streaming server.
|
void |
initializeConsumer(String sequenceName)
Consume the message received and inject into the sequence.
|
public StreamingListener(String subject, NatsInjectHandler injectHandler, Properties natsProperties)
public boolean createConnection() throws IOException, InterruptedException
createConnection
in interface NatsMessageListener
IOException
InterruptedException
public void initializeConsumer(String sequenceName) throws InterruptedException, IOException, TimeoutException
initializeConsumer
in interface NatsMessageListener
sequenceName
- the sequence to inject the message to.InterruptedException
IOException
TimeoutException
public void closeConnection()
closeConnection
in interface NatsMessageListener
Copyright © 2022 WSO2. All rights reserved.