@Beta public class DefaultMessageDelegator extends Object implements MessageDelegator
A generic message in the context of the SAP Cloud Platform Enterprise Messaging contains a topic on which the message was sent, as well as the content of the message.
Constructor and Description |
---|
DefaultMessageDelegator() |
Modifier and Type | Method and Description |
---|---|
DefaultMessageDelegator |
addListener(MessageListener<? extends Message> listener)
Add a custom, type-safe listener to react on messages sent from the SAP Cloud Platform Enterprise Messaging
service.
|
void |
notifyListeners(MessageTopic messageTopic,
String content)
Method to be called with the topic and the content of a received message.
|
@Nonnull public DefaultMessageDelegator addListener(@Nonnull MessageListener<? extends Message> listener)
addListener
in interface MessageDelegator
listener
- The listener implementation to add.DefaultMessageDelegator
for a fluent API.public void notifyListeners(@Nonnull MessageTopic messageTopic, @Nonnull String content)
This will call all listeners that registered for the specified topic.
notifyListeners
in interface MessageDelegator
messageTopic
- The topic listeners may have registered for.content
- The content of the message.Copyright © 2019 SAP SE. All rights reserved.