@Documented @Retention(value=RUNTIME) @Target(value={METHOD,ANNOTATION_TYPE}) @EventHandler public @interface SagaEventHandler
The parameters of the annotated method are resolved using parameter resolvers.
Axon provides a number of parameter resolvers that allow you to use the following parameter types:
@MetaDataValue
will
resolve to the Meta Data value with the key as indicated on the annotation. If required is false (default), null is
passed when the meta data value is not present. If required is true, the resolver will not match and prevent the
method from being invoked when the meta data value is not present.MetaData
will
have the entire Meta Data of an Event Message injected.Instant
(or any
of its super classes or implemented interfaces) will resolve to the timestamp of the EventMessage. This is the time
at which the Event was generated.Message
will have the entire EventMessage
injected (if the message is assignable to that parameter). If the first parameter is of type message,
it effectively matches an Event of any type, even if generic parameters would suggest otherwise. Due to type erasure,
Axon cannot detect what parameter is expected. In such case, it is best to declare a parameter of the payload type,
followed by a parameter of type Message.<axon:annotation-config/>
is
declared, any other parameters will resolve to autowired beans, if exactly one autowire candidate is available in the
application context. This allows you to inject resources directly into @SagaEventHandler
annotated
methods.EventHandler
Modifier and Type | Required Element and Description |
---|---|
String |
associationProperty
The property in the event that will provide the value to find the Saga instance.
|
Modifier and Type | Optional Element and Description |
---|---|
Class<? extends AssociationResolver> |
associationResolver
The type of AssociationResolver that will resolve the association property value.
|
String |
keyName
The key in the AssociationValue to use.
|
Class<?> |
payloadType
The type of event this method handles.
|
public abstract String associationProperty
public abstract String keyName
associationProperty()
.public abstract Class<?> payloadType
public abstract Class<? extends AssociationResolver> associationResolver
Copyright © 2010–2019. All rights reserved.