SpringSource/spring-amqp — pull request #95 by garyrussell (2013-04-24 18:56:09+00:00)
Title: AMQP-309 Fix Listener Channel Issue

When an external transaction manager is assigned to the listener
container, the fix for AMQP-260 corrected a problem where the
listener's channel was not used by RabbitTemplates running on
the same thread.

This is required for operations performed by the template to
participate in the same transaction.

However, this was too encompasing in that this did not take
into account that the template might be configured with a
different connection factory.

Add a test to show the template with a different connection
factory incorrectly used the listener's channel.

Add code to only use the listener channel if the client is
requesting a channel from the same connection factory.

Also, do not fetch a connection in the case where the
consumer channel is used (actually a no-op because the
single connection is cached).