1 Reply Latest reply on Oct 31, 2008 9:32 AM by Tim Fox

    How To Handle Message Selectors in Ordering Groups

    Yong Hao Gao Master

      How To Handle Message Selectors in Ordering Groups

      The issue is:

      Messages dropped by a message selector are not really 'removed' by the JMS server, to the receiving consumer the messages seemed dropped. The ordering group cannot simply forget the dropped messages, because the messages dropped by one consumer may be acceptable by another consumer (with a different selector or even without a selector). That will make it difficult to handle.

      Suppose we have 10 messages, and there are two consumers with different selectors. The first consumer starts to receive with a selector only accepts the last 5 messages. The second consumer starts to receive with a selector that only accepts the first 3 messages. Suppose the two consumers work serially, under normal case both consumers can received their messages. But if the messages belong to a ordering group, after the first consumer has received the last 5 messages, the second can never get the 3 messages because if it can, the ordering is broken. Actually all the first 5 messages will stay in the JMS Server forever!

      In programming, handling ordering groups with selectors will cause complicated state management and subtle delivery controls, and that perhaps still wouldn't make it possibly work. I tried to change the code and stopped half way simply for fear of totally messing things up and totally ruining my previous work.

      So here I suggest not to support ordering group with message selectors at all.