[INT-4476] MessageHeaders.ID could be automatically mapped to AmqpHeaders.MESSAGE_ID Created: 28/May/18  Updated: 31/May/18  Resolved: 31/May/18

Status: Resolved
Project: Spring Integration
Component/s: AMQP Support
Affects Version/s: 5.0.5
Fix Version/s: 5.1 M1

Type: Improvement Priority: Major
Reporter: László Csontos Assignee: Gary Russell
Resolution: Complete Votes: 0
Labels: PullRequest
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Reference URL: https://stackoverflow.com/questions/50544350/why-are-id-and-timestamp-declared-as-transient-headers-in-spring-integration
Pull Request URL: https://github.com/spring-projects/spring-integration/pull/2462

 Description   

Currently AbstractHeaderMapper
declares MessageHeaders.ID and MessageHeaders.TIMESTAMP as transient fields. As a consequence, when a message gets sent through an AMQP outbound adapter, the value of these two fields gets discarded.

Altought IDs could be fixed by turning on implicit ID generation on the descendants of AbstractMessageConverter (setting createMessageIds=true), that comes with a side effect which is difficult to debug.

The ID of the sent and received messages will defer and it takes some time to debug the call hierarchy from AmqpOutboundEndpoint.sendAndReceive() to AbstractHeaderMapper.getTransientHeaderNames() to understand why.

That said, I'd propose to map ID and TIMESTAMP fields automatically and add the option of defining them as transient fields.


Generated at Tue Feb 25 19:28:57 UTC 2020 using Jira 7.13.8#713008-sha1:1606a5c1e7006e1ab135aac81f7a9566b2dbc3a6.