[jboss-user] [Messaging, JMS & JBossMQ] - Re: Sequential processing of messages with the same Key

adrian@jboss.org do-not-reply at jboss.com
Thu Jul 26 12:14:16 EDT 2007

"mzeijen" wrote : 
  | - Why do I need a topic? Isn't a queue enough because a message only needs to be processed by one receiver?

Because then you need multiple receivers and selectors to get concurrency.
Contested queues with selectors are an anti-pattern for any reasonable
volume of messages (again see other posts).

anonymous wrote : 
  | - Do I need to configure a invoke-proxy-binding for every customer? I do have 700.000 customers, and those can be added dynamically...

You don't create 700,000 subscriptions that would be a management nightmare. ;-)
It would also require every send of a message checking 700,000 selectors to see
which subscription matches the message.

You use a "like", e.g. all customers beginning with A, B, C, etc.
to divide them into groups according to how much concurreny you need.

Or better yet, you use a "hash" of the customer id if you want a better spread.

anonymous wrote : 
  | I thought that the solution would be like a cluster wide locking mechanism. This is what I mean:
  | - A message comes in to the message queue with a certain customer id property
  | - For this id a lock is acquired via the cluster wide singleton locking mechanism by the MB 
  | - The next message for this id is received while the other is still being processed
  | - The process for the second message tries to acquire a lock, but needs to wait for the other process to finish for this id.
  | - The moment the lock is released the next process in line receives the lock and can start processing. In this case the second process.
  | Is this a stupid idea? Am I missing something about the whole JMS technology?

Sounds stupid to me. :-) If I only because I doubt it would scale.
JMS is about asynchronicity, so you need to consider an asynchronous design
(if JMS is even relevant for what you are trying to achieve).

Think of JMS as more like a set of pipes and valves that let you control
where messages flow from and to. You want to direct all messages of a particular
type to a particular destination so they flow "sequentially" down that pipe.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4067897#4067897

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4067897

More information about the jboss-user mailing list