0 Replies Latest reply on Sep 29, 2005 5:14 PM by Sebastian Rohde

    EJB3 Message Driven Bean in a cluster

    Sebastian Rohde Newbie

      Hi,

      I am trying to use a MessageDriven Beans in a cluster of JBoss 4.0.3RC2 machines (all-config from zip archive + EJB3 RC2 applied).

      I want to use non-clustered MDBs. For our Bachelor thesis we have a scenario that requires this fact.

      What I did to accomplish this is the following:

      Annotation at the message driven Bean:
      @MessageDriven(activateConfig =
      {
      @ActivationConfigProperty(propertyName="destinationType",
      propertyValue="javax.jms.Queue"),
      @ActivationConfigProperty(propertyName="destination",
      propertyValue="queue/worldaccess")
      })


      With only one machine this works very well. As soon as there is a second machine there is a different output at deployment:

      First machine:
      WARN [MDB] Could not find the queue destination-jndi-name=queue/worldaccess
      WARN [MDB] destination not found: queue/worldaccess reason: javax.naming.NameNotFoundException: queue/worldaccess
      [MDB] creating a new temporary destination: queue/worldaccess
      23:09:49,296 INFO [worldaccess] Bound to JNDI name: queue/worldaccess
      23:09:49,296 INFO [MDB] JNDI Hashtable: null

      Second machine:
      INFO [MDB] JNDI Hashtable: null

      On the second machine I get a QueueNotBound exception when doing a:
      queue = (Queue) ctx.lookup("queue/worldaccess");

      Maybe it's important that both machines access the same mysql database.

      So now for my question:

      What can I do to get this working under my scenario? The MDB must not be clustered but it has to be on every node in the cluster and work there locally - If this only works with different names - How can I apply different names at runtime?
      Maybe it's also the wrong solution for our problem - We want to get asynchronity on a per node basis without having loadbalancing in the cluster (The cluster is used at other points in our project - Threads seemed to be a bad idea in a session bean, so we decided to use MDB's)


      It would be really nice if someone could answer us on this topix as we are close to the deadline for our bachelor thesis...

      Yours,

      Sebastian Rohde