Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

org.springframework.integration.store.SimpleMessageStore.getMessageGroup(Object) not calling this.groupIdToMessageGroup.put(groupId, group); #9882

Open
brianblank opened this issue Mar 7, 2025 · 1 comment

Comments

@brianblank
Copy link

In what version(s) of Spring Integration are you seeing this issue?

I can verify that the defect is in latest version, but also I see it in older versions.

Describe the bug

If the groupId is new, group becomes null triggering a call to getMessageGrouFactory().create. The generated group on line 224 is immediately returned. However, if this.copyOnGet==false, it should save a copy of the newly created group by calling "this.groupIdToMessageGroup.put(groupId, group);" like on line 275.

A clear and concise description of what the bug is.

To Reproduce

If you call getMessageGroup(), followed by addMessagesToGroup(), a new group is currently getting created for the same groupId.

Expected behavior

The same group should be used in both calls when the copyOnGet==false.

Sample

A link to a GitHub repository with a minimal, reproducible sample.

https://github.com/spring-projects/spring-integration/blob/main/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageStore.java
lines 223-225 has the bug.
lines 274-275 shows expected behaviour.

Reports that include a sample will take priority over reports that do not.
At times, we may require a sample, so it is good to try and include a sample up front.

@brianblank brianblank added status: waiting-for-triage The issue need to be evaluated and its future decided type: bug labels Mar 7, 2025
@artembilan artembilan added this to the 6.5.0-M3 milestone Mar 7, 2025
@artembilan artembilan added in: jdbc for: backport-to-6.3.x for: backport-to-6.4.x and removed status: waiting-for-triage The issue need to be evaluated and its future decided labels Mar 7, 2025
@artembilan
Copy link
Member

Thank you for the report!

Looks like you are fully on board with the problem.
I would appreciate if you can contribute the fix with respective unit test to verify: https://github.com/spring-projects/spring-integration/blob/main/CONTRIBUTING.adoc

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

No branches or pull requests

2 participants