File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Creating single instance of MDB in glassfish cluster Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Creating single instance of MDB in glassfish cluster" Watch "Creating single instance of MDB in glassfish cluster" New topic
Author

Creating single instance of MDB in glassfish cluster

Seema Hemant
Greenhorn

Joined: Mar 07, 2010
Posts: 5
Hi All,

Could you please help me on the following:-

Multiple instances of the MDBs are getting created in parallel (1 on each instance) even though the max-pool-size is set to 1. Due to this, the messages from a queue are getting consumed in parallel - over the 2 instances of the server.How do i create a single instance of the MDB on glassfish cluster?
Note : We are using EJB3.0 and glassfish 2.1 which does not support @Singleton annotation.
ramprasad madathil
Ranch Hand

Joined: Jan 24, 2005
Posts: 489

Posting on the glassfish forum may help better.

As far as I know you have this problem only with topics. An MDB that listens to a topic and deployed across a cluster would each receive one copy of the message. The container views each subscription from the MDB pool in each cluster as an independent one.

With queues, you shouldnt be having this problem since the message is delivered only to one consumer. So even if the MDBs deployed in the cluster are viewed by the container as independent listeners, only one should get the message. That's what a queue is about.

ram.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Creating single instance of MDB in glassfish cluster
 
Similar Threads
Need messge to be consumed once by MDB deployed in a glassfish cluster?
Web Cluster
MDB using a message selector
High volume data processing question
JMS in Clusterd Weblogic