You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MongoDb message store deleting messages from wrong group [INT-3087] #7069
This issue happens when you put the same message (ie. same UUID) onto more than one channel at the same time and the channels are backed by the MongoDb message store.
The message gets inserted to mongo correctly with a groupId representing the channel name. The polling is also correct, it returns the oldest message for a particular groupId:
Query q = new Query(where(GROUP_ID_KEY).is(groupId)).limit(1);
q.with(new Sort(Direction.ASC, CREATED_DATE));
However, when pollMessageFromGroup finds a message it then tries to delete it by calling removeMessage(UUID id). The problem is that this method does not take into account the groupId. It just deletes a single message in the collection with that id. If there are more than one message in the collection with that id, the correct message might not get deleted.
We saw this happening in one of our services. When we sent the same message to two different channels it would sometimes get handled twice by the service activator for one channel and zero times for the other channel's service activator. The problem obviously gets worse if you send the same message to more than two channels.
Activity
spring-operator commentedon Jul 15, 2013
Gary Russell commented
I think this raises a bigger issue with other message store implementation (the same message with the same ID being stored in multiple groups).
This should be addressed by the linked JIRA issue (#6647).
For mongo, we get a separate message instance (because of the wrapper) but for other implementations we don't.
spring-operator commentedon Jul 29, 2013
Artem Bilan commented
PR: #831
spring-operator commentedon Aug 19, 2013
Gary Russell commented
Merged into master and cherry-picked to 2.2.x