public interface NATSConnector
Modifier and Type | Method and Description |
---|---|
void |
flush()
Flushes any pending NATS data.
|
io.nats.client.Connection |
getConnection()
Advanced API to get the NATS connection.
|
io.nats.client.ConnectionFactory |
getConnectionFactory()
Advanced API to get the Connection Factory, This allows for NATS functionality beyond
the interface here.
|
void |
publish(io.nats.client.Message message)
Publishes a message into the NATS cluster.
|
void |
shutdown()
In case of a critical failure or security issue, this allows the plugin
to request a shutdown of the connector.
|
void |
subscribe(String subject)
Adds interest in a NATS subject.
|
void |
subscribe(String subject,
io.nats.client.MessageHandler handler)
Adds interest in a NATS subject, with a custom handle.
|
void |
subscribe(String subject,
String queue)
Adds interest in a NATS subject with a queue group.
|
void |
subscribe(String subject,
String queue,
io.nats.client.MessageHandler handler)
Adds interest in a NATS subject with a queue group, with a custom handler.
|
void |
unsubscribe(String subject)
Removes interest in a NATS subject
|
void shutdown()
void publish(io.nats.client.Message message)
message
- - the message to publish.void flush() throws Exception
Exception
- - an error occurred in the flush.void subscribe(String subject) throws Exception
subject
- - subject of interest.Exception
- - an error occurred in the subsciption process.void subscribe(String subject, io.nats.client.MessageHandler handler) throws Exception
subject
- - subject of interest.handler
- - message handlerException
- - an error occurred in the subsciption process.void subscribe(String subject, String queue) throws Exception
subject
- - subject of interest.queue
- - work queueException
- - an error occurred in the subsciption process.void subscribe(String subject, String queue, io.nats.client.MessageHandler handler) throws Exception
subject
- - subject of interest.queue
- - work queuehandler
- - message handlerException
- - an error occurred in the subsciption process.void unsubscribe(String subject)
subject
- - subject of interest.io.nats.client.Connection getConnection()
io.nats.client.ConnectionFactory getConnectionFactory()
Copyright © 2015–2016 Apcera, Inc.. All rights reserved.