Skip to content

Preserve the originalMessage when creating an ErrorMessage in MessageBuilder#23417

Closed
L00kian wants to merge 1 commit into
spring-projects:masterfrom
L00kian:messaging-preserveOriginalMessage
Closed

Preserve the originalMessage when creating an ErrorMessage in MessageBuilder#23417
L00kian wants to merge 1 commit into
spring-projects:masterfrom
L00kian:messaging-preserveOriginalMessage

Conversation

@L00kian

@L00kian L00kian commented Aug 5, 2019

Copy link
Copy Markdown

Hello,

I was creating a small POC using spring integration and for some cases I noticed that Gateways that use messagingTemplate underneath do not preserve the original message when sending a related ErrorMessage to the error channel.

I didn't find any better place to address that.

In my opinion original message worth preserving in any case. However there is another possibility to pass the MessageBuilder.originalMessage link without unwrapping it

…ew ErrorMessage using MessageBuilder.fromMessage method.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Aug 5, 2019
@L00kian

L00kian commented Aug 6, 2019

Copy link
Copy Markdown
Author

Also if the aforementioned is the case - it might be worthwhile to apply the same flow for org.springframework.integration.support.MessageBuilder#build implementation from integration-core package

@rstoyanchev rstoyanchev added in: messaging Issues in messaging modules (jms, messaging) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Nov 8, 2019
@rstoyanchev rstoyanchev self-assigned this Nov 8, 2019
@rstoyanchev rstoyanchev added this to the 5.2.2 milestone Nov 8, 2019
@rstoyanchev rstoyanchev changed the title Preserve the originalMessage when creating new message using MessageBuilder Preserve the originalMessage when creating an ErrorMessage in MessageBuilder Nov 8, 2019
rstoyanchev pushed a commit that referenced this pull request Nov 8, 2019
@rstoyanchev

Copy link
Copy Markdown
Contributor

This has been merged with some minor polishing.

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

Labels

in: messaging Issues in messaging modules (jms, messaging) type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants