INT-3499 AMQP Confirms/Returns Polishing

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

- Suppress expected exception from log in test case
- Suppress (log) 'null' payload error when no correlation data
- Enforce a specific amqp template reference in the parser when using confirms/returns
- Change tests to use a dedicated template for confirms/returns
This commit is contained in:
Gary Russell
2014-08-19 10:40:11 -04:00
parent d43b89dedc
commit 8b5c1c5053
6 changed files with 34 additions and 13 deletions

View File

@@ -481,18 +481,20 @@ public Object handle(@Payload String payload, @Header(AmqpHeaders.CHANNEL) Chann
</callout>
<callout arearefs="amqp-outbound-channel-adapter-xml-8-co" id="amqp-outbound-channel-adapter-xml-8">
<para>An expression defining correlation data. When provided, this configures the underlying
amqp template to receive publisher confirms. Requires a <classname>RabbitTemplate</classname> and a
amqp template to receive publisher confirms. Requires a dedicated
<classname>RabbitTemplate</classname> and a
<classname>CachingConnectionFactory</classname> with the <code>publisherConfirms</code> property
set to <code>true</code>. When a publisher confirm
is received, it is written to either the confirm-ack-channel, or the confirm-nack-channel,
is received, and correlation data is supplied,
it is written to either the confirm-ack-channel, or the confirm-nack-channel,
depending on the confirmation type. The payload of the confirm is the correlation data as
defined by this expression and the message will have a header 'amqp_publishConfirm' set to
true (ack) or false (nack). Examples: "headers['myCorrelationData']", "payload".
<emphasis>Optional</emphasis>.</para>
<para>
Starting with <emphasis>version 4.1</emphasis> the new <code>amqp_publishConfirmNackCause</code>
message header has been added. It contains a <code>cause</code> message of 'nack' for publisher
confirm.
Starting with <emphasis>version 4.1</emphasis> the <code>amqp_publishConfirmNackCause</code>
message header has been added. It contains the <code>cause</code> of a 'nack' for publisher
confirms.
</para>
</callout>
<callout arearefs="amqp-outbound-channel-adapter-xml-9-co" id="amqp-outbound-channel-adapter-xml-9">
@@ -512,8 +514,8 @@ public Object handle(@Payload String payload, @Header(AmqpHeaders.CHANNEL) Chann
amqp_returnReplyText, amqp_returnExchange, amqp_returnRoutingKey</emphasis>.
<emphasis>Optional</emphasis>.</para>
<important>
Using a <code>return-channel</code> requires a <classname>RabbitTemplate</classname> with either
the <code>mandatory</code> or <code>immediate</code> properties set to <code>true</code>,
Using a <code>return-channel</code> requires a <classname>RabbitTemplate</classname> with
the <code>mandatory</code> property set to <code>true</code>,
and a <classname>CachingConnectionFactory</classname>
with the <code>publisherReturns</code> property set to <code>true</code>. When using multiple
outbound endpoints with returns, a separate <classname>RabbitTemplate</classname> is needed
@@ -643,8 +645,8 @@ public Object handle(@Payload String payload, @Header(AmqpHeaders.CHANNEL) Chann
amqp_returnReplyText, amqp_returnExchange, amqp_returnRoutingKey</emphasis>.
<emphasis>Optional</emphasis>.</para>
<important>
Using a <code>return-channel</code> requires a <classname>RabbitTemplate</classname> with either
the <code>mandatory</code> or <code>immediate</code> properties set to <code>true</code>,
Using a <code>return-channel</code> requires a <classname>RabbitTemplate</classname> with
the <code>mandatory</code> property set to <code>true</code>,
and a <classname>CachingConnectionFactory</classname>
with the <code>publisherReturns</code> property set to <code>true</code>. When using multiple
outbound endpoints with returns, a separate <classname>RabbitTemplate</classname> is needed