Commit 1317215
GH-846: Fix send and receive with confirms
Fixes #846
Send and receive with a direct container (the default) fails on the second
operation because the template is not registered as a listener with the
callback channel.
`doSendAndReceiveWithDirect` does not invoke `doSendAndReceiveAsListener`
within `execute` because the channel is obtained from the container.
The first send and receive succeeds because `execute` is invoked once in the
`useDirectReplyTo` which determines whether the broker supports direct
reply-to.
`addListener()` is called from `execute()` after a channel has been received
from the cache.
Fix is to call `addListener()` from `doSendAndReceiveWithDirect`.
**cherry-pick to 2.0.x**
# Conflicts:
# spring-rabbit/src/test/java/org/springframework/amqp/rabbit/core/RabbitTemplatePublisherCallbacksIntegrationTests3.java1 parent 381cf24 commit 1317215
File tree
1 file changed
+5
-2
lines changed- spring-rabbit/src/main/java/org/springframework/amqp/rabbit/core
1 file changed
+5
-2
lines changedLines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1661 | 1661 | | |
1662 | 1662 | | |
1663 | 1663 | | |
1664 | | - | |
1665 | | - | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
1666 | 1669 | | |
1667 | 1670 | | |
1668 | 1671 | | |
| |||
0 commit comments