@Target(value=METHOD) @Retention(value=RUNTIME) @Documented @MessageMapping public @interface SqsListener
Message
onto listener
methods by matching to the message destination. The destination can be a logical queue
name (CloudFormation), a physical queue name or a queue URL.
Listener methods which are annotated with this annotation are allowed to have flexible signatures. They may have arguments of the following types, in arbitrary order:
Message
to get access to the complete message being processed.Payload
-annotated
method arguments to extract the payload of a message and optionally convert it using a
MessageConverter
.
The presence of the annotation is not required since it is assumed by default
for method arguments that are not annotated.
Header
-annotated
method arguments to extract a specific header value along with type conversion with a
org.springframework.core.convert.converter.Converter
if necessary.Headers
-annotated
argument that must also be assignable to Map
for getting access to all headers.MessageHeaders
arguments for
getting access to all headers.MessageHeaderAccessor
Acknowledgment
to be able to acknowledge the reception
of a message an trigger the deletion of it. This argument is only available when using the deletion policy
SqsMessageDeletionPolicy.NEVER
.Additionally a deletion policy can be chosen to define when a message must be deleted once the listener method
has been called. To get an overview of the available deletion policies read the SqsMessageDeletionPolicy
documentation.
By default the return value is wrapped as a message and sent to the destination
specified with an @SendTo
method-level annotation.
Modifier and Type | Optional Element and Description |
---|---|
SqsMessageDeletionPolicy |
deletionPolicy
Defines the deletion policy that must be applied once the listener method was called.
|
String[] |
value
List of queues.
|
public abstract String[] value
public abstract SqsMessageDeletionPolicy deletionPolicy
Copyright © 2019 Pivotal Software, Inc.. All rights reserved.