Class SimpleCorrelationDataProvider

java.lang.Object
org.axonframework.messaging.correlation.SimpleCorrelationDataProvider
All Implemented Interfaces:
CorrelationDataProvider

public class SimpleCorrelationDataProvider extends Object implements CorrelationDataProvider
CorrelationDataProvider implementation defines correlation headers by the header names. The headers from messages with these keys are returned as correlation data.
Since:
2.3
Author:
Allard Buijze
  • Constructor Details

    • SimpleCorrelationDataProvider

      public SimpleCorrelationDataProvider(String... metaDataKeys)
      Initializes the CorrelationDataProvider to return the meta data of messages with given metaDataKeys as correlation data.
      Parameters:
      metaDataKeys - The keys of the meta data entries from messages to return as correlation data
  • Method Details

    • correlationDataFor

      public Map<String,?> correlationDataFor(Message<?> message)
      Description copied from interface: CorrelationDataProvider
      Provides a map with the entries to attach as correlation data to generated messages while processing given message.

      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.

      Specified by:
      correlationDataFor in interface CorrelationDataProvider
      Parameters:
      message - The message to define correlation data for
      Returns:
      the data to attach as correlation data to generated messages