@Beta public class JmsMessageDelegator extends Object implements javax.jms.MessageListener
MessageListener
implementation that gives you the option to register a type-safe
MessageListener
in a JMS context.Constructor and Description |
---|
JmsMessageDelegator(MessageDelegator delegate)
Instantiates this class and expects an instance of
MessageDelegator that is informed upon the reception
of a JMS message. |
JmsMessageDelegator(MessageDelegator delegate,
JmsMessagingVdmConverter jmsMessageConverter)
Instantiates this class and expects an instance of
MessageDelegator plus an instance of a
JmsMessagingVdmConverter . |
Modifier and Type | Method and Description |
---|---|
void |
addListener(MessageListener<?> listener)
Add a custom, type-safe listener to react on messages sent from the SAP Cloud Platform Enterprise Messaging
service.
|
void |
onMessage(javax.jms.Message message)
This method is called with every message received by the application.
|
public JmsMessageDelegator(@Nonnull MessageDelegator delegate)
MessageDelegator
that is informed upon the reception
of a JMS message. An instance of JmsMessagingVdmConverter
with default configuration will be used.delegate
- The message delegatorpublic JmsMessageDelegator(@Nonnull MessageDelegator delegate, @Nonnull JmsMessagingVdmConverter jmsMessageConverter)
MessageDelegator
plus an instance of a
JmsMessagingVdmConverter
.delegate
- The message delegatorjmsMessageConverter
- The instance of JmsMessagingVdmConverter
to use when translating JMS messages to Messaging VDM
objects.public void onMessage(@Nullable javax.jms.Message message)
This implementation then redirects these messages to the corresponding registered listeners which will receive this message in a type-safe way.
onMessage
in interface javax.jms.MessageListener
message
- The message received by the application.public void addListener(@Nonnull MessageListener<?> listener)
listener
- The listener implementation to add.Copyright © 2019 SAP SE. All rights reserved.