Skip to content

Commit 0a7ea59

Browse files
artembilangaryrussell
authored andcommitted
GH-3601: Bring AMQP byte code compatibility back
Fixes #3601 The issue #3584 has introduced a regression when old constructor with an `AbstractMessageListenerContainer` was removed in favor of just `MessageListenerContainer`. But with that change all the dependant projects must be recompiled, which is not a case when Spring Cloud was not released against the latest Spring Boot. **Cherry-pick to `5.4.x`**
1 parent 91d09c8 commit 0a7ea59

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

spring-integration-amqp/src/main/java/org/springframework/integration/amqp/inbound/AmqpInboundChannelAdapter.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ public enum BatchMode {
123123

124124
private BatchMode batchMode = BatchMode.MESSAGES;
125125

126+
// TODO Remove in 6.0
127+
public AmqpInboundChannelAdapter(AbstractMessageListenerContainer listenerContainer) {
128+
this((MessageListenerContainer) listenerContainer);
129+
}
130+
126131
/**
127132
* Construct an instance using the provided container.
128133
* @param listenerContainer the container.

spring-integration-amqp/src/main/java/org/springframework/integration/amqp/inbound/AmqpInboundGateway.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,24 @@ public AmqpInboundGateway(AbstractMessageListenerContainer listenerContainer) {
101101
this(listenerContainer, new RabbitTemplate(listenerContainer.getConnectionFactory()), false);
102102
}
103103

104+
// TODO Remove in 6.0
104105
/**
105-
* Construct {@link AmqpInboundGateway} based on the provided {@link MessageListenerContainer}
106+
* Construct {@link AmqpInboundGateway} based on the provided {@link AbstractMessageListenerContainer}
106107
* to receive request messages and {@link AmqpTemplate} to send replies.
107108
* @param listenerContainer the {@link MessageListenerContainer} to receive AMQP messages.
108109
* @param amqpTemplate the {@link AmqpTemplate} to send reply messages.
109110
* @since 4.2
110111
*/
112+
public AmqpInboundGateway(AbstractMessageListenerContainer listenerContainer, AmqpTemplate amqpTemplate) {
113+
this((MessageListenerContainer) listenerContainer, amqpTemplate);
114+
}
115+
116+
/**
117+
* Construct {@link AmqpInboundGateway} based on the provided {@link MessageListenerContainer}
118+
* to receive request messages and {@link AmqpTemplate} to send replies.
119+
* @param listenerContainer the {@link MessageListenerContainer} to receive AMQP messages.
120+
* @param amqpTemplate the {@link AmqpTemplate} to send reply messages.
121+
*/
111122
public AmqpInboundGateway(MessageListenerContainer listenerContainer, AmqpTemplate amqpTemplate) {
112123
this(listenerContainer, amqpTemplate, true);
113124
}

0 commit comments

Comments
 (0)