@Bean @ConditionalOnMissingBean public RoutingStrategy routingStrategy() { return new AnnotationRoutingStrategy(); }
/** * Initializes the command bus with the given <code>connector</code> and an {@link AnnotationRoutingStrategy}. * * @param connector the connector that connects the different command bus segments */ public DistributedCommandBus(CommandBusConnector connector) { this(connector, new AnnotationRoutingStrategy()); }
/** * Initialize the connector using the given {@code localSegment} to handle commands on the local node, and the * given * {@code channel} to connect between nodes. A unique {@code clusterName} should be chose to define which nodes can * connect to each other. The given {@code serializer} is used to serialize messages when they are sent between * nodes. * <p> * Commands are routed based on the {@link org.axonframework.commandhandling.TargetAggregateIdentifier} * Uses a cached thread pool {@link ExecutorService} containing the {@link AxonThreadFactory} to create threads * which deal with the message receiving process. * * @param localSegment The CommandBus implementation that handles the local Commands * @param channel The JGroups Channel used to communicate between nodes * @param clusterName The name of the Cluster * @param serializer The serializer to serialize Command Messages with */ public JGroupsConnector(CommandBus localSegment, JChannel channel, String clusterName, Serializer serializer) { this(localSegment, channel, clusterName, serializer, new AnnotationRoutingStrategy()); }
@Bean @ConditionalOnMissingBean public RoutingStrategy routingStrategy() { return new AnnotationRoutingStrategy(UnresolvedRoutingKeyPolicy.RANDOM_KEY); } }
@Bean @ConditionalOnMissingBean public RoutingStrategy routingStrategy() { return new AnnotationRoutingStrategy(); }