Skip to content

Spring Integration 6.0 to 6.1 Migration Guide

Artem Bilan edited this page Apr 13, 2023 · 3 revisions

Removal of MQTT ConsumerStopAction

Previously deprecated org.springframework.integration.mqtt.core.ConsumerStopAction and its functionality has been removed in favor of existing org.eclipse.paho.client.mqttv3.ConnectionOptions.cleanSession option.

Do Not Block By Default

According to distributed systems design and bad experience of demo developing it is not OK to block forever. Most of the timeouts in the framework are now 30 seconds by default. They were previously -1 or Long.MIN_VALUE which means wait for operation completion indefinitely. Only one remained as 1 seconds is a PollingConsumer where it is better to not block even for those 30 seconds when no messages in the queue, but let the polling task be rescheduled. This fixed the problem with a single thread in a pool for auto-configured TaskScheduler. Now with a 1 second of wait time we are able to switch to other scheduled tasks even with only 1 thread in the pool.

Filter WARN About Discarded Message

The MessageFilter now emits a WARN logging message when a Message is dropped: no discardChannel and throwExceptionOnRejection is false. Essentially, a default behavior of the filter is to not be silent, but rather WARN in the logs. If the previous behavior is acceptable, it is recommended to set a nullChannel as a discardChannel for filter endpoint.

No IntegrationComponentSpec.get() any more

The IntegrationComponentSpec is a FactoryBean by itself and therefore it follows its lifecycle requirements when it is declared as a bean. In addition, the IntegrationComponentSpec might not only be a wrapper around one target object: it may manage and expose other supporting components for target Spring Integration endpoints. For this purpose a ComponentsRegistration contract can be implemented on the IntegrationComponentSpec. Spring Integration Java DSL and its supporting BeanPostProcessor handles an IntegrationComponentSpec and its ComponentsRegistration aspect, but for this task to be performed properly the IntegrationComponentSpec must be provided for the framework as is. Therefore we have deprecated a get() method with removal in the next version.

Fir example, a bean definition like this:

@Bean(PollerMetadata.DEFAULT_POLLER)
PollerMetadata defaultPoller() {
    return Pollers.fixedDelay(100).get();
}

Must migrate now to this:

@Bean(PollerMetadata.DEFAULT_POLLER)
PollerSpec defaultPoller() {
    return Pollers.fixedDelay(100);
}
Clone this wiki locally