Skip to content

Commit

Permalink
Revert "GH-9455: Introduce IntegrationKeepAlive (#9493)"
Browse files Browse the repository at this point in the history
This reverts commit 8f838d0.
  • Loading branch information
artembilan committed Sep 30, 2024
1 parent cdcffd7 commit 2cf2f10
Show file tree
Hide file tree
Showing 12 changed files with 1 addition and 374 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
import org.springframework.integration.config.xml.IntegrationNamespaceUtils;
import org.springframework.integration.context.IntegrationContextUtils;
import org.springframework.integration.context.IntegrationProperties;
import org.springframework.integration.endpoint.management.IntegrationKeepAlive;
import org.springframework.integration.handler.LoggingHandler;
import org.springframework.integration.handler.support.IntegrationMessageHandlerMethodFactory;
import org.springframework.integration.json.JsonPathUtils;
Expand Down Expand Up @@ -130,7 +129,6 @@ public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) t
registerListMessageHandlerMethodFactory();
registerIntegrationConfigurationReport();
registerControlBusCommandRegistry();
registerKeepAlive();
}

@Override
Expand Down Expand Up @@ -462,15 +460,4 @@ private static BeanDefinitionBuilder createMessageHandlerMethodFactoryBeanDefini
IntegrationContextUtils.ARGUMENT_RESOLVER_MESSAGE_CONVERTER_BEAN_NAME);
}

private void registerKeepAlive() {
if (!this.beanFactory.containsBean(IntegrationContextUtils.INTEGRATION_KEEP_ALIVE_BEAN_NAME)) {
BeanDefinitionBuilder builder =
BeanDefinitionBuilder.genericBeanDefinition(IntegrationKeepAlive.class)
.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);

this.registry.registerBeanDefinition(IntegrationContextUtils.INTEGRATION_KEEP_ALIVE_BEAN_NAME,
builder.getBeanDefinition());
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,8 @@ public abstract class IntegrationContextUtils {

public static final String LIST_MESSAGE_HANDLER_FACTORY_BEAN_NAME = "integrationListMessageHandlerMethodFactory";

/**
* The bean name for the {@code org.springframework.integration.support.management.ControlBusCommandRegistry}.
* @since 6.4
*/
public static final String CONTROL_BUS_COMMAND_REGISTRY_BEAN_NAME = "controlBusCommandRegistry";

/**
* The bean name for the {@code org.springframework.integration.endpoint.management.IntegrationKeepAlive}.
* @since 6.4
*/
public static final String INTEGRATION_KEEP_ALIVE_BEAN_NAME = "integrationKeepAlive";

/**
* The default timeout for blocking operations like send and receive messages.
* @since 6.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

/**
* Utility class to encapsulate infrastructure Integration properties constants and their default values.
* The default values can be overridden by the {@code META-INF/spring.integration.properties} with these entries
* The default values can be overridden by the {@code META-INF/spring.integration.properties} with this entries
* (includes their default values):
* <ul>
* <li> {@code spring.integration.channels.autoCreate=true}
Expand All @@ -38,7 +38,6 @@
* <li> {@code spring.integration.channels.error.requireSubscribers=true}
* <li> {@code spring.integration.channels.error.ignoreFailures=true}
* <li> {@code spring.integration.endpoints.defaultTimeout=30000}
* <li> {@code spring.integration.keepAlive=true}
* </ul>
*
* @author Artem Bilan
Expand Down Expand Up @@ -118,12 +117,6 @@ public final class IntegrationProperties {
*/
public static final String ENDPOINTS_DEFAULT_TIMEOUT = INTEGRATION_PROPERTIES_PREFIX + "endpoints.defaultTimeout";

/**
* Set to {@code false} to fully disable Keep-Alive thread.
* @since 6.4
*/
public static final String KEEP_ALIVE = INTEGRATION_PROPERTIES_PREFIX + "keepAlive";

private static final Properties DEFAULTS;

private boolean channelsAutoCreate = true;
Expand All @@ -146,8 +139,6 @@ public final class IntegrationProperties {

private long endpointsDefaultTimeout = IntegrationContextUtils.DEFAULT_TIMEOUT;

private boolean keepAlive = true;

private volatile Properties properties;

static {
Expand Down Expand Up @@ -321,30 +312,11 @@ public long getEndpointsDefaultTimeout() {
/**
* Configure a value for {@link #ENDPOINTS_DEFAULT_TIMEOUT} option.
* @param endpointsDefaultTimeout the value for {@link #ENDPOINTS_DEFAULT_TIMEOUT} option.
* @since 6.2
*/
public void setEndpointsDefaultTimeout(long endpointsDefaultTimeout) {
this.endpointsDefaultTimeout = endpointsDefaultTimeout;
}

/**
* Return the value of {@link #KEEP_ALIVE} option.
* @return the value of {@link #KEEP_ALIVE} option.
* @since 6.4
*/
public boolean isKeepAlive() {
return this.keepAlive;
}

/**
* Configure a value for {@link #KEEP_ALIVE} option.
* Defaults {@code true} - set to {@code false} disable keep-alive thread.
* @param keepAlive {@code false} to disable keep-alive thread.
*/
public void setKeepAlive(boolean keepAlive) {
this.keepAlive = keepAlive;
}

/**
* Represent the current instance as a {@link Properties}.
* @return the {@link Properties} representation.
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/**
* Provides classes related to endpoint management.
*/
@org.springframework.lang.NonNullApi
@org.springframework.lang.NonNullFields
package org.springframework.integration.endpoint.management;
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ spring.integration.messagingTemplate.throwExceptionOnLateReply=false
spring.integration.readOnly.headers=
spring.integration.endpoints.noAutoStartup=
spring.integration.endpoints.defaultTimeout=30000
spring.integration.keepAlive=true
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.endpoint.AbstractEndpoint;
import org.springframework.integration.endpoint.management.IntegrationKeepAlive;
import org.springframework.integration.test.util.TestUtils;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
import org.springframework.test.annotation.DirtiesContext;
Expand Down Expand Up @@ -53,9 +52,6 @@ public class IntegrationContextTests {
@Autowired
private ThreadPoolTaskScheduler taskScheduler;

@Autowired
private IntegrationKeepAlive integrationKeepAlive;

@Test
public void testIntegrationContextComponents() {
assertThat(this.integrationProperties.isMessagingTemplateThrowExceptionOnLateReply()).isTrue();
Expand All @@ -66,7 +62,6 @@ public void testIntegrationContextComponents() {
assertThat(this.serviceActivator.isRunning()).isFalse();
assertThat(this.serviceActivatorExplicit.isAutoStartup()).isTrue();
assertThat(this.serviceActivatorExplicit.isRunning()).isTrue();
assertThat(this.integrationKeepAlive.isRunning()).isTrue();
}

}
Loading

0 comments on commit 2cf2f10

Please sign in to comment.