Skip to content

Use latest Spring Framework 7.1.0-SNAPSHOT - #11351

Open
cppwfs wants to merge 3 commits into
spring-projects:mainfrom
cppwfs:GH-7-2-SNAPSHOT
Open

Use latest Spring Framework 7.1.0-SNAPSHOT#11351
cppwfs wants to merge 3 commits into
spring-projects:mainfrom
cppwfs:GH-7-2-SNAPSHOT

Conversation

@cppwfs

@cppwfs cppwfs commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

The latest snapshots have introduced some breaking changes.
Resolve the issues below

  • Treat a null result from MessageConverter.fromMessage() as a
    conversion failure across all inbound JMS paths.
  • Throw MessageConversionException from AbstractJmsChannel,
    JmsDestinationPollingSource, ChannelPublishingJmsMessageListener,
    and JmsOutboundGateway instead of silently discarding the message.
  • Remove the discard branch in SubscribableJmsChannel since a null
    conversion is no longer possible without an exception.
  • Add tests asserting MessageConversionException for each of the
    four affected components.
  • Updated core to use builder for SpelParserConfiguration as the
    constructor is now deprecated.

@cppwfs cppwfs added this to the 7.2.0-M2 milestone Aug 20, 2026
@cppwfs
cppwfs requested a review from artembilan August 20, 2026 19:16

@artembilan artembilan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, repurpose this PR just for SF 7.2.0-SNAPSHOT.
Looks like this is going to take a while until it is in a good shape.
The rest of dependencies should not suffer.

Thanks

@cppwfs

cppwfs commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

This change includes those that were in PR #11367. So if this one still needs alot of work then merge 11367 and I'll continue work on this PR.

@cppwfs
cppwfs force-pushed the GH-7-2-SNAPSHOT branch 2 times, most recently from db5bc01 to 0ecf55c Compare August 24, 2026 16:50
@cppwfs cppwfs changed the title Update release train dependencies to the current snapshots. Set Spring Dependencies back to snapshot Aug 24, 2026

@artembilan artembilan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is something what deserves some docs, too.
Including whats-new.

Thanks

/**
* @author Glenn Renfro
*/
public class JmsDestinationPollingSourceTests implements TestApplicationContextAware {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we agreed that public is redundant in tests.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not fixed.
I see changes in the test methods, but class declaration could also benefit from not having public modifier 😄

@artembilan

Copy link
Copy Markdown
Member

I mean.
Document JMS part as it is some kind of breaking change.

@artembilan artembilan added the for: upgrade-attention Breaking change, some extra configuration etc. label Aug 24, 2026
@artembilan

Copy link
Copy Markdown
Member

Also, please, add a comment into this PR with a Attention required: hint explaining how JMS module now fails for null conversion results.
Thanks

cppwfs added 2 commits August 25, 2026 07:44
  - The latest snapshots have introduced some breaking changes.
    Resolve the issues below
  - Treat a null result from `MessageConverter.fromMessage()` as a
  conversion failure across all inbound JMS paths.
  - Throw `MessageConversionException` from `AbstractJmsChannel`,
  `JmsDestinationPollingSource`, `ChannelPublishingJmsMessageListener`,
  and `JmsOutboundGateway` instead of silently discarding the message.
  - Remove the discard branch in `SubscribableJmsChannel` since a null
  conversion is no longer possible without an exception.
  - Add tests asserting `MessageConversionException` for each of the
  four affected components.
  - Updated core to use builder for `SpelParserConfiguration` as the
   constructor is now deprecated.
- Update docs to reflect SI's response to framewworks changes to
   Jms message conversion
- Add author tags
@artembilan artembilan changed the title Set Spring Dependencies back to snapshot Use latest Spring Framework 7.1.0-SNAPSHOT Aug 25, 2026
}

/**
* Converts {@link jakarta.jms.Message} to a Spring {@link Message}.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method Javadocs must be imperative, like commands.

}

/**
* Processes an incoming JMS message, transforms it into a Spring Integration message,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this Javadoc was generated by AI.
Please, revise it as it is too much info.
And it is not imperative.

* @param jmsMessage the incoming {@link jakarta.jms.Message} to process
* @param session the active JMS {@link jakarta.jms.Session} associated with the listener
* @throws JMSException if a native JMS error occurs while processing, resolving destinations, or sending replies
* @throws MessageConversionException if payload extraction produces a {@code null} result when required

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is only case.
The message converter may thrown such an exception for other reason.
We probably should rephrase it somehow saying that in case of null such an exception is thrown, too.
Or what is better wording would it be from English perspective 😄

@@ -408,6 +423,9 @@ public void onMessage(jakarta.jms.Message jmsMessage, Session session) throws JM
result = this.messageConverter.fromMessage(jmsMessage);
this.logger.debug(() -> "converted JMS Message [" + jmsMessage + "] to integration Message payload ["

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And no this debug message is suspicious with null result.
I think we need to revise logic as if..else.

* Will receive a JMS {@link jakarta.jms.Message} converting and returning it as
* a Spring Integration {@link Message}. This method will also use the current
* {@link JmsHeaderMapper} instance to map JMS properties to the MessageHeaders.
* @throws MessageConversionException if the converter returns {@code null}.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DITTO

source.setBeanFactory(TEST_INTEGRATION_CONTEXT);
source.afterPropertiesSet();

// A JMS message converted to a null payload is a conversion failure, not a message to discard.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DITTO

}

@Test
void payloadFromConverterIsUsed() throws Exception {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see value in this test.
Or better to say: we do have such a coverage in other tests in the module.

when(session.createProducer(any())).thenReturn(mock());
MessageConsumer consumer = mock();
when(session.createConsumer(any())).thenReturn(consumer);
when(consumer.receive(anyLong())).thenReturn(mock());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See MockSettings instead of all of these, e.g. Answers.RETURNS_MOCKS.
More over I think this is too much just for an exception in the end.
See if StubConnection and friends can help anyhow instead of this mock nightmare.

See the xref:http.adoc[HTTP Support] chapter for more information about these and other changes.

[[x7.2-jms-changes]]
=== JMS Support Changes

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed blank line after the title.

[[x7.2-jms-changes]]
=== JMS Support Changes
Spring Integration supports Spring Framework's ability to return `null` when converting a JMS `Message` where the payload has not been set.
This also means that if a Spring `Message` uses the payload of a JMS `Message` that is null, a `MessageConversionException` will be thrown.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this text needs to be revised.
It is also missing a link to the target chapter.
And I don't see a change in the target chapter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

for: upgrade-attention Breaking change, some extra configuration etc. in: jms type: task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants