Class MultiCorrelationDataProvider

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

public class MultiCorrelationDataProvider extends Object implements CorrelationDataProvider
A CorrelationDataProvider that combines the data of multiple other correlation providers.

When multiple instance provide the same keys, a delegate will override the entries provided by previously resolved delegates.

Since:
2.3.0
Author:
Allard Buijze
  • Constructor Details

    • MultiCorrelationDataProvider

      public MultiCorrelationDataProvider(@Nonnull List<? extends CorrelationDataProvider> correlationDataProviders)
      Initialize a MultiCorrelationDataProvider, delegating to given correlationDataProviders.
      Parameters:
      correlationDataProviders - The CorrelationDataProviders to delegate to.
  • Method Details

    • correlationDataFor

      @Nonnull public Map<String,String> correlationDataFor(@Nonnull 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.