SpringSource/spring-amqp — pull request #61 by garyrussell (2012-07-18 19:29:50+00:00)
Title: AMQP-255 Fix Multi Confirm with > 1 Listener

Rabbit can piggy-back confirms - for example, if seq 1, 2, 3 are
sent, it is possible to receive ack #3 with 'multiple' set. These
means 1, 2, and 3 are acked.

This worked fine with just one listener. However, if two or
more listeners (e.g. rabbit templates) are attached, only the
listener for ack #3 is notified (regardless of whether all
the acks belong to it).

The PublisherCallbackChannel maintains two maps: seq-to-listener
and listener-to-map(seq-to-correlation).

This fixes the problem by first finding all the listeners that
have pending confirms at or below the sequence number; and then
uses the second map to send the confirms to the appropriate
listener.