Skip to content

MongoDb message store deleting messages from wrong group [INT-3087] #7069

Closed

Description

@spring-operator

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:

Activity

  1. spring-operator commented on Jul 15, 2013

    @spring-operator
    ContributorAuthor

    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.

  2. spring-operator commented on Jul 29, 2013

    @spring-operator
    ContributorAuthor

    Artem Bilan commented

    PR: #831

  3. spring-operator commented on Aug 19, 2013

    @spring-operator
    ContributorAuthor

    Gary Russell commented

    Merged into master and cherry-picked to 2.2.x

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions