INT-3807: AmqpInboundGateway Improvements

JIRA: https://jira.spring.io/browse/INT-3807

Addressing PR comments

INT-3807: Polishing
This commit is contained in:
Artem Bilan
2015-08-20 11:44:32 -04:00
committed by Gary Russell
parent 7464168845
commit 02565d0401
9 changed files with 176 additions and 57 deletions

View File

@@ -227,7 +227,9 @@ The inbound gateway supports all the attributes on the inbound channel adapter (
mapped-request-headers="" <4>
mapped-reply-headers="" <5>
reply-channel="myReplyChannel" <6>
reply-timeout="1000" /> <7>
reply-timeout="1000" <7>
amqp-template="" <8>
default-reply-to="" /> <9>
----
@@ -268,6 +270,17 @@ _Optional_.
If not specified this property will default to "1000" (1 second).
Only applies if the container thread hands off to another thread before the reply is sent.
<8> The customized `AmqpTemplate` bean reference to have more control for the reply messages to send or you can provide
an alternative implementation to the `RabbitTemplate`.
<9> The `replyTo` `org.springframework.amqp.core.Address` to be used when the `requestMessage` doesn't have `replyTo`
property.
If this option isn't specified, no `amqp-template` is provided, and no `replyTo` property exists in the request message,
an `IllegalStateException` is thrown because the reply can't be routed.
If this option isn't specified, and an external `amqp-template` is provided, no exception will be thrown.
You __must__ either specify this option, or configure a default `exchange` and `routingKey` on that template,
if you anticipate cases when no `replyTo` property exists in the request message.
See the note in <<amqp-inbound-channel-adapter>> about configuring the `listener-container` attribute.
[[amqp-inbound-ack]]

View File

@@ -252,10 +252,18 @@ See <<conditional-pollers>> for more information.
The `<int-amqp:outbound-gateway>` now supports `confirm-correlation-expression` and `confirm-(n)ack-channel`
attributes with similar purpose as for `<int-amqp:outbound-channel-adapter>`.
===== Correlation Data
For both the outbound channel adapter and gateway, if the correlation data is a `Message<?>`, it will be the basis
of the message on the ack/nack channel, with the additional header(s) added.
Previously, any correlation data (including `Message<?>`) was returned as the payload of the ack/nack message.
===== The Inbound Gateway properties
The `<int-amqp:inbound-gateway>` now exposes the `amqp-template` attribute to allow more control over an external bean
for the reply `RabbitTemplate` or even provide your own `AmqpTemplate` implementation.
In addition the `default-reply-to` is exposed to be used if request message doesn't have `replyTo` property.
See <<amqp>> for more information.
[[x4.2-xpath-splitter]]