Annotation Interface Payload
Annotation that binds a method parameter to the payload of a message. Can also
be used to associate a payload to a method invocation. The payload may be passed
through a
MessageConverter
to convert it from serialized form with a
specific MIME type to an Object matching the target method parameter.- Since:
- 4.0
- Author:
- Rossen Stoyanchev, Sam Brannen
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionA SpEL expression to be evaluated against the payload object as the root context.boolean
Whether payload content is required.Alias forexpression()
.
-
Element Details
-
value
Alias forexpression()
.- Default:
- ""
-
expression
A SpEL expression to be evaluated against the payload object as the root context.This attribute may or may not be supported depending on whether the message being handled contains a non-primitive Object as its payload or is in serialized form and requires message conversion.
This attribute is not supported for:
- STOMP over WebSocket messages
- RSocket interface client
- Since:
- 4.2
- Default:
- ""
-
required
boolean requiredWhether payload content is required.Default is
true
, leading to an exception if there is no payload. Switch tofalse
to havenull
passed when there is no payload.- Default:
- true
-