3 Replies Latest reply on Dec 12, 2001 6:44 AM by Peter Antman

    Local Topics and Queues

    Jose Alberto Fernandez Newbie

      Hi, in an EJB application, I am using very few remote objects (only entry points) and use EJBs for most of the functionality. Several parts of the application use messaging and MDB to communicate

      My question is, is it possible to define queues and topics which are extrictly local in nature? Where we are guaranteed that even in a clustered environment
      the equally defined message providers and consumers on each node will only be visible to the MDBs in that local node (since the MDBs are only interested on messages produced by other local EJBs).

      I am new to JBoss and want to know if such architecture can use some particular optimizations from JBoss (a specialized JMS providers perhaps).

      Thanks for any info.

        • 1. Re: Local Topics and Queues
          Peter Antman Expert

          The default for JBoss is optimized in this case, since the MDB:s use an in vm connection factory. But it does not mean that your MDB is not "accessable" from the ouside. All JMS destinations are accessable, and thereby the MDB:s.


          • 2. Re: Local Topics and Queues
            Jose Alberto Fernandez Newbie

            Let me tell you my assumptions so that you understand the analogy I am trying to make.

            I assume that even in a cluster, if I use EJB references, I am guaranteed that the EJB I create will be running on the same JVM as the creator.

            Even thought I may have the remote object running in several JVMs of the cluster, each one will keep any servicing local EJBs, on their own local machine.

            What I would like to have the ability to do the same with JMS processing. Have the JMS messages sent by EJBs running on one machine, being served by local instances of the MDB, just like with the analogy with local EJBs.

            Today, you could do such thing by binding a separate JMS queue/topic to the same jndi name on each machine in the cluster, but that sounds like a deployment nightmare. It would be much nicer, if the JMS implementation would keep things separate for you. So you just bind the same "local" queue/topic and you get the desired effect.


            Jose Alberto

            • 3. Re: Local Topics and Queues
              Peter Antman Expert

              Hi, I am sorry but I have not looked into the cluster stuff yet, the only thing I do know is that there is not cluster support in MDB or in JBossMQ. Anyone that want's that would have to contribute it ;-).

              As for destinations in MDB and other EJB the default is allways local. You have to change the ProviderAdapter to get remote destinations to work.

              You might however benifit from the "automagic code" in MDB:s. If you deploy and MDB with a destination that does not exists, a temorary one (allwasy local) is created. This might be dangerous (the destination is not there when the MDB is not deployed, and the destination will be destroyed when the MDB is undeployed) or great because you can skip setting up destinations.

              If you have other ideas how to implement the MDB container, pleas contribute ideas and code snipets.