public class MessageOriginProvider extends Object implements CorrelationDataProvider
identifier of a Message to
other messages that are created as result of processing the first message.| Constructor and Description |
|---|
MessageOriginProvider()
Initializes a
MessageOriginProvider that uses the default correlation id key: getDefaultCorrelationKey() and trace id key: getDefaultTraceKey(). |
MessageOriginProvider(String correlationKey,
String traceKey)
Initializes a
MessageOriginProvider that uses the given correlationKey. |
| Modifier and Type | Method and Description |
|---|---|
Map<String,?> |
correlationDataFor(Message<?> message)
Provides a map with the entries to attach as correlation data to generated messages while processing given
message. |
static String |
getDefaultCorrelationKey()
Returns the default metadata key for the correlation id of a message.
|
static String |
getDefaultTraceKey()
Returns the default metadata key for the trace id of a message.
|
public MessageOriginProvider()
MessageOriginProvider that uses the default correlation id key: getDefaultCorrelationKey() and trace id key: getDefaultTraceKey().public MessageOriginProvider(String correlationKey, String traceKey)
MessageOriginProvider that uses the given correlationKey.correlationKey - the key used to store the identifier of a message in the metadata of a resulting messagetraceKey - the key used to store the identifier of the original message giving rise to the current
messagepublic static String getDefaultCorrelationKey()
public static String getDefaultTraceKey()
public Map<String,?> correlationDataFor(Message<?> message)
CorrelationDataProvidermessage.
This method should not return null. Any exception thrown from this method might interfere with rolling
back a transaction. Therefore, by default exceptions are caught, ignoring the correlation data that should have
been added.correlationDataFor in interface CorrelationDataProvidermessage - The message to define correlation data forCopyright © 2010–2025. All rights reserved.