2 Replies Latest reply on Mar 17, 2003 11:24 AM by ftg314159

    Stupid Newbie JMS/EJB Question

    ftg314159

      I'm sure I should have looked somewhere else, but I couldn't figure out where. This is just a fundamental question about using a message-driven bean to listen to a queue.

      The (non-JBoss) examples I've seen just don't show how a deployment descriptor links a queue name to the MDB which is intended to service it. Monson's book seems to imply that it is a vendor-specific issue, but I can't see why it should be.

      How do I tell a container to associate a certain queue name with a certain MDB ?

        • 1. Re: Stupid Newbie JMS/EJB Question
          raja05

          you can define the queue jndi name in jboss.xml descriptor.

          as far as creating queues is concerned, you can do it in jbossmq-destinations-service.xml

          Hope this is what you are asking for

          -Raj

          • 2. Re: Stupid Newbie JMS/EJB Question
            ftg314159

            Thanks, after some reflection (and a peek at the Monson book workbook notes for JBoss 3.0), it dawned on me why a little of this is in the ejb-jar.xml, and the important parts are in vendor-specific files.

            Basically, EJBs need a vendor-neutral way to interact with JMS and other container-managed components (like JDBC), but containers don't get the same consideration, since they are vendor-specific by definition.

            MDBs don't need to know the topic or queue which they are servicing, so that's not in ejb-jar.xml. They need a way to reference topics or queues to which they send messages, so they use <resource-ref> entries in ejb-jar.xml. In all cases, the deployer has to put info in the vendor-specific deployment descriptor files which can match up with what's in ejb-jar.xml, e.g. define the JNDI JMS name to be used as input for an MDB, or to be connected to a <resource-ref> name used by the MDB.

            Not really intuitive, but logical.