Class SimpleCorrelationDataProvider
java.lang.Object
org.axonframework.messaging.core.correlation.SimpleCorrelationDataProvider
- All Implemented Interfaces:
CorrelationDataProvider
A
key
names.
CorrelationDataProvider implementation that defines correlation data by the
invalid reference
Message#metaData()
The metadata entries from messages matching these keys are returned as correlation data.
- Since:
- 2.3.0
- Author:
- Allard Buijze
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleCorrelationDataProvider(String... metadataKeys) Initializes aSimpleCorrelationDataProviderthat returns theMessage.metadata()entries of givenmessagesthat match the givenmetadataKeysas correlation data. -
Method Summary
Modifier and TypeMethodDescriptioncorrelationDataFor(Message message) Provides a map with the entries to attach as correlation data to generated messages while processing givenmessage.
-
Constructor Details
-
SimpleCorrelationDataProvider
Initializes aSimpleCorrelationDataProviderthat returns theMessage.metadata()entries of givenmessagesthat match the givenmetadataKeysas correlation data.- Parameters:
metadataKeys- The keys of theMessage.metadata()entries frommessagesto return as correlation data.
-
-
Method Details
-
correlationDataFor
Description copied from interface:CorrelationDataProviderProvides a map with the entries to attach as correlation data to generated messages while processing givenmessage. This method should not returnnull. 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.- Specified by:
correlationDataForin interfaceCorrelationDataProvider- Parameters:
message- The message to define correlation data for.- Returns:
- The data to attach as correlation data to generated messages.
-