2 Replies Latest reply on Jul 19, 2009 10:48 PM by gaohoward

    clustered grouping issue

    ataylor

      Ive just about completed clustered grouping using a single node approach. I have one edge case that I'm not sure how to solve.

      The problem.

      Lets say a group is bound to node 1 that has a single consumer. Another node, node 2, currently forwarding messages with a specific group id to node 1.

      At this point node the consumer is removed from node 1, however since node 2 is not yet notified of this removal it carries on forwarding messages.

      At some point node 2 realizes that node 1 no longer has any consumers so must make a decision as to where to forward messages to. The problem is however that it must be sure that the queue on node 1 has redistributed all the messages with the same groupid before it restarts sending.

      One solution would be to wait until node 1 has informed us that all the messages for the queue have been redistributed. The problem with this is that there could be a lot of messages in the queue, which could take a while and also if a consumer is added before all the messages are redistributed then we may have messages still in the queue with a groupid that have to be redistributed.

      another solution would be to have a special groupIdRedistributor. When a consumer that is pinned to a group is removed we create a Redistributor with a filter that matches the groupid. The messages are consumed and redistributed to another node and then the nodes are informed they can start redelivering. The problem here is when does the consumer know when all the messages have been delivered.

      A simple solution would be to have a delay time larger than the redistribution delay time. we simply hold back on delivering the message until the delay has elapsed and then restart. Not sure if this would fly tho'