Skip to content

Spring Integration 7.1 to 7.2 Migration Guide

Artem Bilan edited this page Nov 18, 2026 · 6 revisions

Paho-based MQTT support

The spring-integration-mqtt module and its types are deprecated for removal in Spring Integration 7.2. Use the spring-integration-mqtt-client module, which is based on the HiveMQ MQTT client, for new MQTT integrations.

When migrating an existing integration, replace the org.springframework.integration:spring-integration-mqtt dependency with org.springframework.integration:spring-integration-mqtt-client. Update the Spring Integration MQTT components to use the org.springframework.integration.mqtt.client packages and adapt client configuration to the HiveMQ API. For example, the new module provides Mqtt3ClientManager and Mqtt5ClientManager instead of Mqttv3ClientManager and Mqttv5ClientManager. It also provides Mqtt3MessageDrivenChannelAdapter and Mqtt5MessageDrivenChannelAdapter for inbound adapters. Paho connection options and callback implementations need to be adapted to the corresponding HiveMQ APIs.

See MQTT Support

Java deserialization allow list

The AllowListDeserializingConverter no longer allows all classes when no patterns are configured. By default, it now allows only the framework and JDK types listed in AllowListDeserializingConverter.DEFAULT_ALLOWED_PATTERNS. Arrays are checked by their component type, and Number subclasses are no longer allowed implicitly: only the listed number types are. This affects every component built on this converter, including the PayloadDeserializingTransformer, the JdbcMessageStore, the JdbcChannelMessageStore, the MongoDB message stores and the SerializingHttpMessageConverter.

Applications that deserialize their own types (payloads, header values or custom exception types in stored ErrorMessage instances), including messages already in a store, get a SecurityException on read until those types are allowed. Use addAllowedPatterns() to allow them in addition to the defaults, for example:

JdbcMessageStore store = new JdbcMessageStore(dataSource);
store.addAllowedPatterns("com.example.orders.*");

Use setAllowedPatterns() to replace the defaults with your own list. With XML configuration, the <int-jdbc:message-store> element provides the mutually exclusive allowed-patterns (extends the defaults) and allowed-patterns-override (replaces them) attributes. The "*" pattern restores the previous unrestricted behavior; use it only when all sources are trusted.

See Java Deserialization.

Error message headers

The DefaultErrorMessageStrategy now copies the original message headers into the ErrorMessage when an input message is available in the error context. Previously, the original message was available through ErrorMessage.getOriginalMessage(), but its headers were not copied to the error message itself.

Review error-handling flows, header-based routers, and tests that assume error messages do not contain the original headers, including replyChannel and errorChannel. If an error flow must not propagate particular headers, remove them explicitly; use a custom ErrorMessageStrategy if the previous header behavior is required.

See Error Handling.

AMQP publisher confirms

The AMQP outbound channel adapter now honors wait-for-confirm="true" with simple publisher confirms, even when a message has no correlation data. In this case, sending uses RabbitTemplate.invoke() and waits for confirmation with waitForConfirmsOrDie().

If an existing adapter has this option enabled with simple confirms, sends that previously did not wait now block for confirmation and can fail on a negative acknowledgment or timeout. Review the confirm timeout and error handling, or disable wait-for-confirm if waiting is not intended. The connection factory must support publisher confirms; otherwise, the option only produces a warning and no confirmations are awaited.

See AMQP Outbound Channel Adapter.

AMQP delayed delivery

Support for the RabbitMQ Delayed Message Exchange Plugin is deprecated for removal, aligned with Spring AMQP 4.2. The delay and delayExpression options on the AMQP outbound endpoints (delay-expression in XML) and the Java DSL are deprecated for removal. Migrate to the RabbitMQ 4.4 native delayed delivery for quorum queues via the new deliveryTimeExpression option (delivery-time-expression in XML), which must evaluate to an absolute Instant, Date or epoch milliseconds, not a relative delay.

The DefaultAmqpHeaderMapper no longer maps the AmqpHeaders.DELAY and AmqpHeaders.RECEIVED_DELAY headers by default. Flows that set the AmqpHeaders.DELAY message header to delay an outbound message must use the delayExpression option instead (for example, headers['amqp_delay']), otherwise the message is sent without a delay. Inbound flows that rely on the AmqpHeaders.RECEIVED_DELAY header no longer receive it. The x-opt-delivery-time header is mapped by default, even though other x-* headers are not.

See Delayed Message Delivery.

Feed entries without dates

The FeedEntryMessageSource now falls back to the feed's published date when none of its entries has an updated or published date. All such entries are emitted again when the feed's date advances; a feed that uses its generation time can therefore cause entries to be emitted on every poll. In feeds containing both dated and undated entries, undated entries are sorted last and can be emitted again alongside new dated entries.

If downstream processing requires each entry to be handled only once, add an Idempotent Receiver keyed by SyndEntry.getUri() or another stable entry identifier instead of relying only on timestamp-based duplicate detection.

See Duplicate Entries.

JDBC

Metadata store schema

The METADATA_VALUE column in the JdbcMetadataStore schema scripts is now NOT NULL. For an existing database, remove rows whose METADATA_VALUE is NULL, then alter the column to NOT NULL using the appropriate DDL for the database. The default table name is INT_METADATA_STORE; account for any configured table prefix. Updating the dependency does not alter an existing table, so include this change in the application's database migration.

See JDBC Metadata Store.

Apache Derby deprecation

The DerbyChannelMessageStoreQueryProvider and schema-derby.sql are deprecated for removal. Spring Framework 7.1 also deprecates EmbeddedDatabaseType.DERBY. They remain available in this release, but applications using Derby should plan to migrate their database, schema initialization, and message-store query provider to another supported database. For embedded tests, use H2 or HSQLDB and the matching schema scripts and query provider.

HTTP

RestTemplate-based outbound configuration

The RestTemplate-based configuration for the outbound gateway and outbound channel adapter is deprecated for removal. Replace the XML rest-template attribute with rest-client, and replace the corresponding Java DSL and constructor arguments with their RestClient alternatives. Existing RestTemplate customizations can be carried over with RestClient.create(restTemplate) while migrating to direct RestClient configuration.

Replace the deprecated ResponseErrorHandler-based setErrorHandler() or Java DSL errorHandler() configuration with RestClient.ResponseSpec.ErrorHandler via setDefaultStatusHandler() or the Java DSL defaultStatusHandler() methods. With XML configuration, the error-handler attribute (a ResponseErrorHandler reference) is deprecated; use the new default-status-handler attribute with a RestClient.ResponseSpec.ErrorHandler bean instead. When supplying an external RestClient, configure status handlers on its builder rather than on the endpoint. The deprecated configuration remains available for backward compatibility in 7.2.

See HTTP Outbound Components.

JMS messages with no payload

Spring Framework's JMS MessageConverter implementations may now return null from fromMessage() for a JMS message with no payload. Spring Integration treats a null conversion result as a conversion failure and raises a MessageConversionException, which may be wrapped or routed through the component's error handling. This affects AbstractJmsChannel, JmsDestinationPollingSource, ChannelPublishingJmsMessageListener, and JmsOutboundGateway.

Review producers and custom converters to ensure messages intended for payload extraction produce a non-null payload, and adjust error handling and tests for body-less messages. If a flow intentionally handles the raw JMS message, disable payload extraction where supported: extract-payload for an inbound channel adapter, extract-request-payload for an inbound gateway, or extract-reply-payload for an outbound gateway. Downstream components must then handle a jakarta.jms.Message payload rather than its converted body.

See JMS Support.

Clone this wiki locally