Skip to content

Commit d7a7bbb

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 fba4b20 commit d7a7bbb

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
@@ -119,6 +119,11 @@ public enum BatchMode {
119119

120120
private BatchMode batchMode = BatchMode.MESSAGES;
121121

122+
// TODO Remove in 6.0
123+
public AmqpInboundChannelAdapter(AbstractMessageListenerContainer listenerContainer) {
124+
this((MessageListenerContainer) listenerContainer);
125+
}
126+
122127
/**
123128
* Construct an instance using the provided container.
124129
* @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
@@ -98,13 +98,24 @@ public AmqpInboundGateway(AbstractMessageListenerContainer listenerContainer) {
9898
this(listenerContainer, new RabbitTemplate(listenerContainer.getConnectionFactory()), false);
9999
}
100100

101+
// TODO Remove in 6.0
101102
/**
102-
* Construct {@link AmqpInboundGateway} based on the provided {@link MessageListenerContainer}
103+
* Construct {@link AmqpInboundGateway} based on the provided {@link AbstractMessageListenerContainer}
103104
* to receive request messages and {@link AmqpTemplate} to send replies.
104105
* @param listenerContainer the {@link MessageListenerContainer} to receive AMQP messages.
105106
* @param amqpTemplate the {@link AmqpTemplate} to send reply messages.
106107
* @since 4.2
107108
*/
109+
public AmqpInboundGateway(AbstractMessageListenerContainer listenerContainer, AmqpTemplate amqpTemplate) {
110+
this((MessageListenerContainer) listenerContainer, amqpTemplate);
111+
}
112+
113+
/**
114+
* Construct {@link AmqpInboundGateway} based on the provided {@link MessageListenerContainer}
115+
* to receive request messages and {@link AmqpTemplate} to send replies.
116+
* @param listenerContainer the {@link MessageListenerContainer} to receive AMQP messages.
117+
* @param amqpTemplate the {@link AmqpTemplate} to send reply messages.
118+
*/
108119
public AmqpInboundGateway(MessageListenerContainer listenerContainer, AmqpTemplate amqpTemplate) {
109120
this(listenerContainer, amqpTemplate, true);
110121
}

0 commit comments

Comments
 (0)