Is there a way to have mutiple instances of the consumer running on different server instances read from the same queue and ensure that each message is processed by one and only one of the consumers. I'd like to do this to spread the load over the various machines.

Andreas Mueller

JMS specifically does not define how messages delivered to a queue are load balanced across multiple consumers. It does not define an optional mechanism for doing this. The reason it does not is that this involves complicated APIs that are quite hard to define in a vendor neutral form. The EJB 2.0 message-driven bean facility addresses this need by making the J2EE server responsible for integrating JMS, and if the container provides some form of clustering/load balancing, then the container handles this complexity. JMS vendors may provide some form of load balancing, but if they do, it is completely outside the JMS specification. (Original answer from Mark Hapner, Sun Microsystems)

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact