Class MetaDataRoutingStrategy

java.lang.Object
org.axonframework.commandhandling.distributed.AbstractRoutingStrategy
org.axonframework.commandhandling.distributed.MetaDataRoutingStrategy
All Implemented Interfaces:
RoutingStrategy

public class MetaDataRoutingStrategy extends AbstractRoutingStrategy
RoutingStrategy implementation that uses the value in the MetaData of a CommandMessage assigned to a given key. The value's toString() is used to convert the MetaData value to a String.
Since:
2.0
Author:
Allard Buijze
  • Constructor Details

    • MetaDataRoutingStrategy

      protected MetaDataRoutingStrategy(MetaDataRoutingStrategy.Builder builder)
      Instantiate a MetaDataRoutingStrategy based on the fields contained in the give builder.

      Will assert that the metaDataKey is not an empty String or null and will throw an AxonConfigurationException if this is the case.

      Parameters:
      builder - the MetaDataRoutingStrategy.Builder used to instantiate a MetaDataRoutingStrategy instance
    • MetaDataRoutingStrategy

      @Deprecated public MetaDataRoutingStrategy(String metaDataKey)
      Deprecated.
      in favor of the builder()
      Initializes the MetaDataRoutingStrategy where the given metaDataKey is used to get the Meta Data value. An error is raised when the MetaData key cannot be found.
      Parameters:
      metaDataKey - the key on which the value is retrieved from the MetaData
    • MetaDataRoutingStrategy

      @Deprecated public MetaDataRoutingStrategy(String metaDataKey, UnresolvedRoutingKeyPolicy unresolvedRoutingKeyPolicy)
      Deprecated.
      in favor of the builder()
      Initializes the MetaDataRoutingStrategy where the given metaDataKey is used to get the Meta Data value. The given unresolvedRoutingKeyPolicy prescribes what to do when the Meta Data properties cannot be found.
      Parameters:
      metaDataKey - the key on which the value is retrieved from the MetaData
      unresolvedRoutingKeyPolicy - the policy prescribing behavior when the routing key cannot be resolved
  • Method Details