@Target(value={METHOD,ANNOTATION_TYPE}) @Retention(value=RUNTIME) @Documented public @interface Gateway
GatewayProxyFactoryBean
where the annotation attributes can override the default channel settings.
A method annotated with @Gateway may accept a single non-annotated
parameter of type Message
or of the intended Message payload type. Method parameters may be mapped
to individual Message header values by using the
@Header
parameter annotation. Alternatively, to pass the entire Message headers
map, a Map-typed parameter may be annotated with
Headers
.
Return values from the annotated method may be of any type. If the
declared return value is not a Message, the reply Message's payload will be
returned and any type conversion as supported by Spring's
SimpleTypeConverter
will be applied to
the return value if necessary.
Note: unlike @Publisher, this annotation is for exposing a Messaging Endpoint based on a Proxy for the marked interface method. The method invocation causes messaging interaction using an AOP Advice. Method parameters become the part of sent message (payload, headers). The method return value is the result (payload) of the messaging flow invoked by the Proxy.
MessagingGateway
Modifier and Type | Optional Element and Description |
---|---|
GatewayHeader[] |
headers
Specify additional headers that will be added to the request message.
|
String |
payloadExpression
Specify a SpEL expression to determine the payload of the request message.
|
String |
replyChannel
Specify the channel from which reply messages will be received; overrides the
encompassing gateway's default reply channel.
|
long |
replyTimeout
Specify the time (ms) that the thread sending the request will wait for a reply.
|
String |
replyTimeoutExpression
Specify a SpEL Expression to determine the the time (ms) that the thread sending
the request will wait for a reply.
|
String |
requestChannel
Specify the channel to which messages will be sent; overrides the encompassing
gateway's default request channel.
|
long |
requestTimeout
Specify the timeout (ms) when sending to the request channel - only applies if the
send might block (such as a bounded
QueueChannel that is currently full. |
String |
requestTimeoutExpression
Specify a SpEL Expression to determine the timeout (ms) when sending to the request
channel - only applies if the send might block (such as a bounded
QueueChannel that is currently full. |
public abstract String requestChannel
public abstract String replyChannel
public abstract long requestTimeout
QueueChannel
that is currently full.
Overrides the encompassing gateway's default request timeout.requestTimeoutExpression()
public abstract String requestTimeoutExpression
QueueChannel
that is currently full. Overrides the encompassing gateway's
default request timeout. Overrides requestTimeout()
.public abstract long replyTimeout
replyTimeoutExpression()
public abstract String replyTimeoutExpression
replyTimeout()
.public abstract String payloadExpression
public abstract GatewayHeader[] headers