public class MessagingVdmConverter extends Object
String topics + payloads into Messaging VDM objects.
This relies on MessageFactoryMapper objects to pick the right MessageFactory based on the message
topics.
Multiple MessageFactoryMapper objects can be configured, and each MessageFactoryMapper can have
mappings for the same message topic. In this case, the mapping of the most recently added
MessageFactoryMapper is used.| Constructor and Description |
|---|
MessagingVdmConverter(MessageFactoryMapper... messageFactoryMappers)
Creates a converter instance with the provided
MessageFactoryMapper instances. |
| Modifier and Type | Method and Description |
|---|---|
void |
addMessageFactoryMappers(MessageFactoryMapper... messageFactoryMappers)
Augment existing converter with provided
MessageFactoryMapper instances. |
Message |
fromMessage(String topicName,
String payload)
Translates original message topics and string payloads into Messaging VDM objects.
|
public MessagingVdmConverter(@Nonnull MessageFactoryMapper... messageFactoryMappers)
MessageFactoryMapper instances. Note that in case of
duplicate mappings, the one from the right-most MessageFactoryMapper will be used.messageFactoryMappers - Mapping classes that implement the MessageFactoryMapper interface and map topics to message *
factory class names.public void addMessageFactoryMappers(@Nonnull MessageFactoryMapper... messageFactoryMappers)
MessageFactoryMapper instances. Note that in case of duplicate
mappings, the one from the right-most MessageFactoryMapper will be used.messageFactoryMappers - Mapping classes that implement the MessageFactoryMapper interface and map topics to message *
factory class names.@Nonnull public Message fromMessage(@Nonnull String topicName, @Nonnull String payload) throws MessagingException
topicName - The topic of the original message.payload - The original message payload.MessagingException - If there are problems converting the original message into a Messaging VDM object.Copyright © 2019 SAP SE. All rights reserved.