@Documented @Retention(value=RUNTIME) @Target(value={METHOD,CONSTRUCTOR,ANNOTATION_TYPE}) @MessageHandler(messageType=CommandMessage.class) public @interface CommandHandler
AnnotationCommandHandlerAdapter
to subscribe the annotated class to the command bus. This annotation can also be
placed directly on Aggregate members to have it handle the commands directly.
The annotated method's first parameter is the command handled by that method. Optionally, the command handler may
specify a second parameter of type UnitOfWork
. The active Unit of Work will be
passed if that parameter is supplied.Modifier and Type | Optional Element and Description |
---|---|
String |
commandName
The name of the Command this handler listens to.
|
Class<?> |
payloadType
The type of payload expected by this handler.
|
String |
routingKey
The property of the command to be used as a routing key towards this command handler instance.
|
public abstract String commandName
public abstract String routingKey
public abstract Class<?> payloadType
Copyright © 2010–2024. All rights reserved.