0 Replies Latest reply on May 7, 2008 5:56 PM by Jacob Kemp

    Adding Queue or Topic Dependencies to EJBs with JBoss Messag

    Jacob Kemp Newbie

      Recently my project has switched over from using JBossMQ to JBoss Messaging, and I'm having difficulty programatically assigning dependencies on JBoss Messaging Queues and Topics.

      Previously with JBossMQ, we just added the @Depends annotation and specified the Queue or Topic Object Name, but that doesn't seem to be working.

      For example with JBossMQ we used:

      @Depends({"jboss.mq.destination:name=EventTopic,service=Topic"})

      So going off the names shown for this Topic using JBoss Messaging as shown in the JMX Console, the new object name should make the Depends code look like:

      @Depends({"jboss.messaging.destination:name=EventTopic,service=Topic "})

      I can see that this object exists in the JMX Console, but on startup the code with this as a dependency says it's still waiting for it to start up.

      The Topic that we're publishing to is created on startup by the MDB that listens on it. I have used the object name of that MDB as the dependency instead of using the Topic name, like so:

      @Depends({"jboss.j2ee:jar=test.ejb3,name=EventTestMDB,service=EJB3"})

      That made it work correctly, but due to the nature of our project, the names of the MDBs that listen on this Topic will be changing frequently, so I don't want to use this method as it will couple the sender with the receiver, which just seems like bad programming practice.

      I would think there has to be a way to do this the same way that we did it with JBossMQ, but I'm running out of ideas.

      Any help would be greatly appreciated.