public interface MessagingBrokerConnector extends Feature
MessagingBrokerConnector
interface provides the basic functionality for interaction
with any kind of messaging broker.Modifier and Type | Field and Description |
---|---|
static List<MessagingBrokerConnector> |
INSTANCES |
Modifier and Type | Method and Description |
---|---|
void |
connect()
Establishes the connection to the messaging broker.
|
void |
createQueue(String name)
Request the broker for creating a queue with the specified queue name.
|
void |
createQueueSubscription(String queue,
String topic)
Requests the broker for creating a queue topic subscription.
|
void |
emitTopicMessage(String topic,
String message)
Emits the given message to the message broker to the given topic pattern.
|
String |
getNamespace()
Returns the name space if used by the connector.
|
boolean |
isConnected()
Determines whether the connector is already connected to the message broker.
|
void |
registerQueueListener(String queue,
MessagingBrokerQueueListener listener)
Registers the
MessagingBrokerQueueListener implementation to the specified queue of
the message broker. |
getFeatureName, isActiveFeature
static final List<MessagingBrokerConnector> INSTANCES
void connect() throws IOException
IOException
- In case when any connection errors occursboolean isConnected()
true
if connected and false
otherwiseString getNamespace()
void createQueue(String name) throws IOException
true
only when the queue is successfully created or exists already. Otherwise
false
is returned.name
- queue nameIOException
- In case an error occurs while creating the queuevoid createQueueSubscription(String queue, String topic) throws IOException
true
only when the queue topic subscription was successfully created or already available.
Otherwise false
is returned.queue
- the queue nametopic
- the topic the queue should subscribe toIOException
- In case an error occurs during the subscriptionvoid registerQueueListener(String queue, MessagingBrokerQueueListener listener) throws IOException
MessagingBrokerQueueListener
implementation to the specified queue of
the message broker.queue
- the queue namelistener
- implementation of the MessagingBrokerQueueListener
interfaceIOException
- In case when any errors occurs while registering the listener to the brokerCopyright © 2020. All rights reserved.