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.
This commit is contained in:
Gary Russell
2021-06-23 14:50:50 -04:00
parent ab840e24ba
commit 7b9be95310

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2020 the original author or authors.
* Copyright 2014-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,9 @@
package org.springframework.amqp.rabbit.listener;
import org.springframework.amqp.core.MessageListener;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.SmartLifecycle;
import org.springframework.lang.Nullable;
/**
* Internal abstraction used by the framework representing a message
@@ -27,7 +29,7 @@ import org.springframework.context.SmartLifecycle;
* @author Gary Russell
* @since 1.4
*/
public interface MessageListenerContainer extends SmartLifecycle {
public interface MessageListenerContainer extends SmartLifecycle, InitializingBean {
/**
* Setup the message listener to use. Throws an {@link IllegalArgumentException}
@@ -57,4 +59,23 @@ public interface MessageListenerContainer extends SmartLifecycle {
return false;
}
/**
* Set auto startup.
* @param autoStart true to auto start.
* @since 2.3.10
*/
void setAutoStartup(boolean autoStart);
/**
* Get the message listener.
* @return The message listener object.
* @since 2.3.10
*/
@Nullable
Object getMessageListener();
@Override
default void afterPropertiesSet() {
}
}