6 Replies Latest reply on Apr 18, 2003 4:59 AM by adrian.brock

    Help - Simple MDB problem

    sysuser1

      Hi, I'm simply trying to get my MailBean MDB consume a queue from JNDI: "jms/MAIL_MDB_QUEUE"

      <message-driven>
      <configuration-name>MailBean Container Configuration</configuration-name>
      <ejb-name>MailBean</ejb-name>
      <destination-jndi-name>jms/MAIL_MDB_QUEUE</destination-jndi-name>
      </message-driven>

      But JBoss always warns that:

      "destination not found: queue/MAIL_MDB_QUEUE reason: javax.naming.NameNotFoundException: MAIL_MDB_QUEUE not bound

      and ends up creating it dynamically. But this is not the queue which I want it to consume ... my queue is "jms/MAIL_MDB_QUEUE". JBoss seems to replace the "jms" context with "queue" context when it does the lookup from the MDB.

      I have made sure that my queues are defined as "jms/MAIL_MDB_QUEUE", I can even look this up from a standalone JMS client. But the MDB always uses "queue" as the context.

      Why does JBOSS always prepend the JNDI name for MDB's with "queue" ?


      Thanks,
      Trev

        • 1. Re: Help - Simple MDB problem

          Good question.

          It is some horrible code to automatically create
          the destination if it doesn't exist.
          But it assumes the name
          queue/YourQueueName
          regardless of the context you specify.

          It has already been removed in the jboss4
          branch.

          Regards,
          Adrian

          • 2. Re: Help - Simple MDB problem
            sysuser1

            Hi Adrian,

            So do you mean to say that currently, an MDB in JBoss cannot consume a queue that does not start with "queue/" in the JNDI Name ? If I have an application that starts with a context like "jms/" for example, I can not consume this from an MDB ? Are there workarounds for this ?

            thanks!
            Trev

            • 3. Re: Help - Simple MDB problem

              A simple temporary hack would be to create an alias:


              queue/MyQueue
              myContext/MyQueue


              But it needs to be fixed, because both names
              might exist.
              The create if it doesn't exist only works with
              jbossmq anyway.

              Regards,
              Adrian

              • 4. Re: Help - Simple MDB problem

                I've fixed this in the 3.0 and 3.2 branches.
                It now tries the specified destination-jndi-name first.

                Regards,
                Adian

                • 5. Re: Help - Simple MDB problem
                  henryb

                  Thanks for changing the default behavour if the queue naming.

                  I have been reading the posts regarding integration of MQSeries and JBoss (Jboss Forum) with great interest .

                  Does JBOSS and MQSeries working well together ?

                  Does all of the information in the Forums posts still apply? Have things changed for jboss 3.2?

                  I noticed in a post "I Added the following the the jms-service.xml..." this file does not exist in JBOSS 3.2 . I assume the new files are called jms-ds....

                  Is it still necessary to rebuild JBOSS to get a MQSeriesJMSProvider?
                  Can this be avoided? There was discussion on the Post as to whether the default adapter should work fine?

                  Again, in the posts , loshusu said that JMSAdmin can use JBossNS Service directly. I could not make this work??


                  Sorry for all the questions. However, we are trying hard to make this work.


                  Henry

                  • 6. Re: Help - Simple MDB problem

                    I have never tried to use MQSeries
                    with JBoss.

                    You do need a provider so you can tell mdbs
                    which connection factory to use.

                    Yes jms-service.xml has had its name changed
                    to jms-ds.xml

                    Regards,
                    Adrian