Description
Jodie St. John opened INT-3087 and commented
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.
Affects: 2.2.4
Issue Links:
- Refactor JdbcMessageStore - Provide separate implementations for MessageStore and MessageGroupStore [INT-2672] #6647 Refactor JdbcMessageStore - Provide separate implementations for MessageStore and MessageGroupStore