public class FileBasedMessagingBroker extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
FileBasedMessagingBroker.QueueListener
Helper interface for queue listeners
|
| Modifier and Type | Method and Description |
|---|---|
static FileBasedMessagingBroker |
connect(String name,
File exchangeFile)
Installs the file watcher of the specified file.
|
void |
emitMessage(String topic,
String message)
Emits a new message to the file.
|
void |
listenToQueue(String queue,
FileBasedMessagingBroker.QueueListener listener)
Registers a listener to the specified queue.
|
void |
subscribeTopic(String queue,
String topic)
Subscribes a topic to the specified queue.
|
public static FileBasedMessagingBroker connect(String name, File exchangeFile) throws IOException
name - service nameexchangeFile - file to be used for the message exchangeIOException - in case, the service is already connected or the file watching initialization failspublic void emitMessage(String topic, String message)
topic - the topic the message should be send tomessage - the event message to be sentpublic void listenToQueue(String queue, FileBasedMessagingBroker.QueueListener listener)
queue - the queue to listen onlistener - the listenerCopyright © 2021. All rights reserved.