Package de.kentoj.scrowlib.messaging
Interface MessageBroker
- All Known Implementing Classes:
InMemoyMessageBroker,NatsMessageBroker
public interface MessageBroker
-
Method Summary
Modifier and TypeMethodDescriptionvoidhandle(String subject, RequestHandler handler) Registers a handler for a subject, the handler will receive requests and compute some result.voidRuns blocking.org.bson.DocumentRuns blocking.voidsubscribes to a subject, consumer may run asynchronously
-
Method Details
-
publish
Runs blocking. publishes to the message broker- Parameters:
subject- subject to publish to
-
subscribe
subscribes to a subject, consumer may run asynchronously- Parameters:
subject- subject to publish to
-
handle
Registers a handler for a subject, the handler will receive requests and compute some result. The result is sent back as a reply.- Parameters:
subject- subject to publish to
-
request
Runs blocking. Executes an RPC call: The document is published and this method starts listening for incoming replies. The returned Result holds either a document with the requested data, or an error as a string- Parameters:
subject- subject to publish to- Returns:
- RemoteException if the remote throws an exception while handling the request
-