8 Replies Latest reply on May 16, 2012 5:31 PM by ba.nguyen

    Deploying Topics in EAR

    hosier.david

      I'm trying to deploy some JMS topics via an EAR file in JBoss 5.1 and HornetQ 2.0.0GA.  I followed the discussion in the thread at http://community.jboss.org/thread/19053, and I created a hornetq-jms.xml file and placed it in the root of my EAR.  That configuration looks like:

       

       

      <configuration xmlns="urn:hornetq"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">
       
       
          <topic name="osi.notifications.alert">
              <entry name="/topic/osi.notifications.alert" />
          </topic>
       
          <topic name="osi.notifications.managedObject">
              <entry name="/topic/osi.notifications.managedObject" />
          </topic>
       
          <topic name="osi.notifications.mim">
              <entry name="/topic/osi.notifications.mim" />
          </topic>
       
          <topic name="osi.notifications.propagation">
              <entry name="/topic/osi.notifications.propagation" />
          </topic>
          
      </configuration>
      

       

      Once the server is started, I can see all these topics appear to be deployed by checking the org.hornetq category in the jmx-console, and I can see an address and module MBean for each topic there.  My problem is that these topics are not bound in JNDI.  My code gets NamingExceptions, and I confirmed they were missing by checking the JNDIView MBean.  If I put these topics in the existing hornetq-jms.xml under hornetq.sar instead, everything works just fine, and I confirmed the topics are in JNDI through the JNDIView MBean.  Any ideas what the issue may be?

        • 1. Re: Deploying Topics in EAR
          clebert.suconic

          We have developed AS deployers that will parse EARs, WARs.. etc when you deploy to an application server.

           

           

          that's currently only available on AS6/trunk (or a snapshot build of AS6).

           

           

          On AS5 with HornetQ integrated, you will have to pre-configure your destinations.

          1 of 1 people found this helpful
          • 2. Re: Deploying Topics in EAR
            clebert.suconic

            Also, Look at this following thread, as this question was already answered here. There are a few extra deatils there, like the URL for the nightly build:

             

            http://community.jboss.org/thread/150348?tstart=0

            • 3. Re: Deploying Topics in EAR
              hosier.david

              Yeah, I saw that other thread, but I don't really consider that an answer to my question, since the topics seem to be getting picked up and just not being bound to JNDI.  So by "pre-configure", do you mean my option for now is to just keep the topics in hornetq.sar/hornetq-jms.xml?  Thanks for the quick response.

              • 4. Re: Deploying Topics in EAR
                clebert.suconic

                I just don't think the deployment of any xml file currently works with AS5. You need the deployers written at the AS6 for having it properly working.

                 

                If you require XML in your EAR.. you need JBoss AS 6. (That' doesn't work with 5)

                 

                 

                For 5, you will just have to change the files at hornetq.sar as you mentioned.

                • 5. Re: Deploying Topics in EAR
                  hosier.david

                  Okay, that's fine.  Thanks for your quick help.  Although, I am curious how the topics are showing up in the jmx-console when I deploy them in my EAR, given what you are saying.

                  • 6. Re: Deploying Topics in EAR
                    clebert.suconic

                    There was some trying to load those files prior to the integration work we have done on AS6. Like looking at .xml files on the classpath.. but I think there are issues with dependencies.. and proper install of those files.

                     

                    I'm not sure if it's worth pursuing that old model any more. The AS deployers will work in a much better way.

                     

                    Just as a reference, there is a hornetq-int module on the application server, which has all the deployers.

                     

                    http://anonsvn.jboss.org/repos/jbossas/trunk/hornetq-int/

                    • 7. Re: Deploying Topics in EAR
                      pgmjsd

                      In case anyone that uses JBoss AS 6 is reading this and wondering "So how do I include the XML in the EAR?":

                      • Add the HornetQ XML file (e.g. myapp-hornetq-jms.xml) to the META-INF directory and JBoss AS 6 will load it.
                      • If you're using the Maven EAR plugin, put the file in src/main/application/META-INF and the plugin will take care of the rest.

                      You can verify the new JMS destinations in the admin console after deploying.

                      • 8. Re: Deploying Topics in EAR
                        ba.nguyen

                        Does this also apply to Jboss 7?