Skip to content

Commit 7b9be95

Browse files
committed
GH-1352: Spring Integration 5.5 Compatibility
Refactoring to allow Spring Integration 5.5 to be used with both 2.3.x and 2.4.x.
1 parent ab840e2 commit 7b9be95

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/MessageListenerContainer.java

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2020 the original author or authors.
2+
* Copyright 2014-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,7 +17,9 @@
1717
package org.springframework.amqp.rabbit.listener;
1818

1919
import org.springframework.amqp.core.MessageListener;
20+
import org.springframework.beans.factory.InitializingBean;
2021
import org.springframework.context.SmartLifecycle;
22+
import org.springframework.lang.Nullable;
2123

2224
/**
2325
* Internal abstraction used by the framework representing a message
@@ -27,7 +29,7 @@
2729
* @author Gary Russell
2830
* @since 1.4
2931
*/
30-
public interface MessageListenerContainer extends SmartLifecycle {
32+
public interface MessageListenerContainer extends SmartLifecycle, InitializingBean {
3133

3234
/**
3335
* Setup the message listener to use. Throws an {@link IllegalArgumentException}
@@ -57,4 +59,23 @@ default boolean isConsumerBatchEnabled() {
5759
return false;
5860
}
5961

62+
/**
63+
* Set auto startup.
64+
* @param autoStart true to auto start.
65+
* @since 2.3.10
66+
*/
67+
void setAutoStartup(boolean autoStart);
68+
69+
/**
70+
* Get the message listener.
71+
* @return The message listener object.
72+
* @since 2.3.10
73+
*/
74+
@Nullable
75+
Object getMessageListener();
76+
77+
@Override
78+
default void afterPropertiesSet() {
79+
}
80+
6081
}

0 commit comments

Comments
 (0)