org.axonframework.commandhandling.distributed
Enum UnresolvedRoutingKeyPolicy

java.lang.Object
  extended by java.lang.Enum<UnresolvedRoutingKeyPolicy>
      extended by org.axonframework.commandhandling.distributed.UnresolvedRoutingKeyPolicy
All Implemented Interfaces:
Serializable, Comparable<UnresolvedRoutingKeyPolicy>

public enum UnresolvedRoutingKeyPolicy
extends Enum<UnresolvedRoutingKeyPolicy>

Since:
2.0
Author:
Allard Buijze

Enum Constant Summary
ERROR
          Policy that indicates that Routing Key resolution should fail with an Exception when no routing key can be found for a Command Message.
RANDOM_KEY
          Policy that indicates a random key is to be returned when no Routing Key can be found for a Command Message.
STATIC_KEY
          Policy that indicates a fixed key ("unresolved") should be returned when no Routing Key can be found for a Command Message.
 
Method Summary
static UnresolvedRoutingKeyPolicy valueOf(String name)
          Returns the enum constant of this type with the specified name.
static UnresolvedRoutingKeyPolicy[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ERROR

public static final UnresolvedRoutingKeyPolicy ERROR
Policy that indicates that Routing Key resolution should fail with an Exception when no routing key can be found for a Command Message.

When the routing key is based on static content in the Command Message, the exception raised should extend from AxonNonTransientException to indicate that retries do not have a chance to succeed.


RANDOM_KEY

public static final UnresolvedRoutingKeyPolicy RANDOM_KEY
Policy that indicates a random key is to be returned when no Routing Key can be found for a Command Message. Although not required to be fully random, implementations are required to return a different key for each incoming command. Multiple invocations for the same command message may return the same value, but are not required to do so.

This effectively means the Command Message is routed to a random segment.


STATIC_KEY

public static final UnresolvedRoutingKeyPolicy STATIC_KEY
Policy that indicates a fixed key ("unresolved") should be returned when no Routing Key can be found for a Command Message. This effectively means all Command Messages with unresolved routing keys are routed to a the same segment. The load of that segment may therefore not match the load factor.

Method Detail

values

public static UnresolvedRoutingKeyPolicy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (UnresolvedRoutingKeyPolicy c : UnresolvedRoutingKeyPolicy.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static UnresolvedRoutingKeyPolicy valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null


Copyright © 2010-2016. All Rights Reserved.