public interface CommandChannel
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Void> |
prepareDisconnect()
Prepares this
CommandChannel to disconnect, by unsubscribing all registered command handlers. |
Registration |
registerCommandHandler(Function<Command,CompletableFuture<CommandResponse>> handler,
int loadFactor,
String... commandNames)
Registers the given
handler to handle incoming commands with given commandNames, using the given
loadFactor. |
CompletableFuture<CommandResponse> |
sendCommand(Command command)
Sends the give Command to AxonServer for routing to an appropriate handler.
|
Registration registerCommandHandler(Function<Command,CompletableFuture<CommandResponse>> handler, int loadFactor, String... commandNames)
handler to handle incoming commands with given commandNames, using the given
loadFactor. If handlers had already been registered for any of the given command names, this registration
replaces the existing one for those command names. Other commands remain unaffected.handler - the handler to handle incoming commands withloadFactor - the relative load factor for this handlercommandNames - the names of the commands to register the handler forCompletableFuture<CommandResponse> sendCommand(Command command)
command - the command to sendCompletableFuture<Void> prepareDisconnect()
CommandChannel to disconnect, by unsubscribing all registered command handlers. Will wait
with a certain cut off until all acknowledgments of unsubscribing have been received.
This method should be used if a connected client wants to disconnect from AxonServer.
CompletableFuture of Void to react when all command handlers have been unsubscribedCopyright © 2020–2023 AxonIQ BV. All rights reserved.