public class AxonServerCommandBus extends Object implements org.axonframework.commandhandling.CommandBus
CommandBus implementation that connects to Axon Server to submit and receive commands and command
responses. Delegates incoming commands to the provided localSegment.| Constructor and Description |
|---|
AxonServerCommandBus(AxonServerConnectionManager axonServerConnectionManager,
AxonServerConfiguration configuration,
org.axonframework.commandhandling.CommandBus localSegment,
org.axonframework.serialization.Serializer serializer,
org.axonframework.commandhandling.distributed.RoutingStrategy routingStrategy)
Instantiate an Axon Server
CommandBus client. |
AxonServerCommandBus(AxonServerConnectionManager axonServerConnectionManager,
AxonServerConfiguration configuration,
org.axonframework.commandhandling.CommandBus localSegment,
org.axonframework.serialization.Serializer serializer,
org.axonframework.commandhandling.distributed.RoutingStrategy routingStrategy,
CommandPriorityCalculator priorityCalculator)
Instantiate an Axon Server Command Bus client.
|
| Modifier and Type | Method and Description |
|---|---|
void |
disconnect()
Disconnect the command bus from the Axon Server.
|
<C> void |
dispatch(org.axonframework.commandhandling.CommandMessage<C> command) |
<C,R> void |
dispatch(org.axonframework.commandhandling.CommandMessage<C> commandMessage,
org.axonframework.commandhandling.CommandCallback<? super C,? super R> commandCallback) |
org.axonframework.common.Registration |
registerDispatchInterceptor(org.axonframework.messaging.MessageDispatchInterceptor<? super org.axonframework.commandhandling.CommandMessage<?>> dispatchInterceptor) |
org.axonframework.common.Registration |
registerHandlerInterceptor(org.axonframework.messaging.MessageHandlerInterceptor<? super org.axonframework.commandhandling.CommandMessage<?>> handlerInterceptor) |
org.axonframework.common.Registration |
subscribe(String commandName,
org.axonframework.messaging.MessageHandler<? super org.axonframework.commandhandling.CommandMessage<?>> messageHandler) |
public AxonServerCommandBus(AxonServerConnectionManager axonServerConnectionManager, AxonServerConfiguration configuration, org.axonframework.commandhandling.CommandBus localSegment, org.axonframework.serialization.Serializer serializer, org.axonframework.commandhandling.distributed.RoutingStrategy routingStrategy)
CommandBus client. Will connect to an Axon Server instance to submit and
receive commands and command responses.axonServerConnectionManager - a AxonServerConnectionManager which creates the connection to an Axon
Server platformconfiguration - the AxonServerConfiguration containing specifics like the client and
component names used to identify the application in Axon Server among otherslocalSegment - a CommandBus handling the incoming commands for the local applicationserializer - a Serializer used for de/serialization command requests and responsesroutingStrategy - a RoutingStrategy defining where a given CommandMessage should
be routed topublic AxonServerCommandBus(AxonServerConnectionManager axonServerConnectionManager, AxonServerConfiguration configuration, org.axonframework.commandhandling.CommandBus localSegment, org.axonframework.serialization.Serializer serializer, org.axonframework.commandhandling.distributed.RoutingStrategy routingStrategy, CommandPriorityCalculator priorityCalculator)
CommandPriorityCalculator to define the priority of command message among
one another.axonServerConnectionManager - a AxonServerConnectionManager which creates the connection to an Axon
Server platformconfiguration - the AxonServerConfiguration containing client and component names used
to identify the application in Axon ServerlocalSegment - a CommandBus handling the incoming commands for the local applicationserializer - a Serializer used for de/serialization command requests and responsesroutingStrategy - a RoutingStrategy defining where a given CommandMessage should
be routed topriorityCalculator - a CommandPriorityCalculator calculating the request priority based on
the content, and adds this priority to the requestpublic <C> void dispatch(org.axonframework.commandhandling.CommandMessage<C> command)
dispatch in interface org.axonframework.commandhandling.CommandBuspublic <C,R> void dispatch(org.axonframework.commandhandling.CommandMessage<C> commandMessage,
org.axonframework.commandhandling.CommandCallback<? super C,? super R> commandCallback)
dispatch in interface org.axonframework.commandhandling.CommandBuspublic org.axonframework.common.Registration subscribe(String commandName, org.axonframework.messaging.MessageHandler<? super org.axonframework.commandhandling.CommandMessage<?>> messageHandler)
subscribe in interface org.axonframework.commandhandling.CommandBuspublic org.axonframework.common.Registration registerHandlerInterceptor(org.axonframework.messaging.MessageHandlerInterceptor<? super org.axonframework.commandhandling.CommandMessage<?>> handlerInterceptor)
registerHandlerInterceptor in interface org.axonframework.messaging.MessageHandlerInterceptorSupport<org.axonframework.commandhandling.CommandMessage<?>>public void disconnect()
public org.axonframework.common.Registration registerDispatchInterceptor(org.axonframework.messaging.MessageDispatchInterceptor<? super org.axonframework.commandhandling.CommandMessage<?>> dispatchInterceptor)
registerDispatchInterceptor in interface org.axonframework.messaging.MessageDispatchInterceptorSupport<org.axonframework.commandhandling.CommandMessage<?>>Copyright © 2010–2019. All rights reserved.