public class FileBasedBrokerConnector extends Object implements MessagingBrokerConnector
MessagingBrokerConnector
for the file based messaging service.INSTANCES
Constructor and Description |
---|
FileBasedBrokerConnector() |
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 |
getFeatureName() |
String |
getNamespace()
Returns the name space if used by the connector.
|
boolean |
isActiveFeature()
Checks if the feature is activated
|
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. |
public void connect() throws IOException
MessagingBrokerConnector
connect
in interface MessagingBrokerConnector
IOException
- In case when any connection errors occurspublic boolean isConnected()
MessagingBrokerConnector
isConnected
in interface MessagingBrokerConnector
true
if connected and false
otherwisepublic String getNamespace()
MessagingBrokerConnector
getNamespace
in interface MessagingBrokerConnector
public void createQueue(String name) throws IOException
MessagingBrokerConnector
true
only when the queue is successfully created or exists already. Otherwise
false
is returned.createQueue
in interface MessagingBrokerConnector
name
- queue nameIOException
- In case an error occurs while creating the queuepublic void createQueueSubscription(String queue, String topic) throws IOException
MessagingBrokerConnector
true
only when the queue topic subscription was successfully created or already available.
Otherwise false
is returned.createQueueSubscription
in interface MessagingBrokerConnector
queue
- the queue nametopic
- the topic the queue should subscribe toIOException
- In case an error occurs during the subscriptionpublic void registerQueueListener(String queue, MessagingBrokerQueueListener listener) throws IOException
MessagingBrokerConnector
MessagingBrokerQueueListener
implementation to the specified queue of
the message broker.registerQueueListener
in interface MessagingBrokerConnector
queue
- the queue namelistener
- implementation of the MessagingBrokerQueueListener
interfaceIOException
- In case when any errors occurs while registering the listener to the brokerpublic void emitTopicMessage(String topic, String message)
MessagingBrokerConnector
emitTopicMessage
in interface MessagingBrokerConnector
topic
- message topic patternmessage
- the string messagepublic boolean isActiveFeature()
Feature
isActiveFeature
in interface Feature
public String getFeatureName()
getFeatureName
in interface Feature
Copyright © 2020. All rights reserved.