-1

I have two systems that communicate VIA MQSeries .

The system1 send events to System2 over MQ .

We are running into a full clusterized environment so the listener deployed in system2 is "Multiple".

The order of events is very important :

if we have a serie : (event1 , event2 , event3) sent by the system1 , system 2 must process them in the same order otherwise the data is compromised .

How to guarantee with MQSeries that the concurrent consumers listening into the same queue can respect the order of events .

Thanks in advance

Nabil
  • 1,771
  • 4
  • 21
  • 33
  • With these multiple consumers, do you only need to guarantee consume order or do you also need to guarantee processing order. For example, say you had 2 consumers, and event1 was given to consumer1, and event2 was given to consumer2; how do you then guarantee that event2 is not processed first? – Morag Hughson Nov 06 '14 at 08:12
  • I need to guarantee processing – Nabil Nov 11 '14 at 21:51
  • Then this is not a question about MQ - once the message is in your application, you also need to guarantee processing order, you need some sort of locking in your application. What is the reason you have multiple consumers? – Morag Hughson Nov 12 '14 at 13:31
  • I just need a solution without a Single Point of failure . In ActiveMQ i see that this exist (The pattern Exclusive consumer), then you have multiple consumer , and only one is working . if this consumer goes down , another consumer take the lead of processing message . – Nabil Nov 13 '14 at 13:58
  • 1
    WMQ Supports exclusive consumers as well (MQOO_INPUT_EXCLUSIVE), but exclusive consumers do not guarantee message order. However, this will only guarantee that only one consumer will get messages. Without grouping, or other app logic, neither provider can guarantee the messages in the queue are in the order you need to process them. – Erik Williams Nov 13 '14 at 19:12
  • 1
    I think we assumed when you said "multiple consumers" you meant concurrent consumers. Suggest you update your question to indicate that you mean one consumer with another ready to take over consumption if the first is no longer consuming, rather than multiple consumers at one time. These two situations are clearly very different. – Morag Hughson Nov 13 '14 at 20:37

1 Answers1

0

The only way to guarantee message order without some sort of custom application logic with selectors or something, is to use message grouping. I do not recall how or if it can, handle multiple consumers with message groping but this is a good starting point.

Erik Williams
  • 933
  • 6
  • 5