2 Replies Latest reply on May 17, 2010 12:34 PM by Clebert Suconic

    How to configure HornetQ as a resource in Tomcat?

    Stephan Vollmer Newbie

      Hi,

       

      I'm currently evaluating HornetQ as a replacement for ActiveMQ. But I have some problems with the correct configuration. What I'm trying to do is:

       

      • run HornetQ as a standalone application
      • applications run in a Tomcat 6.0.25 server
      • the applications access a JMS ConnectionFactory with a JNDI lookup

       

      At the moment, the configuration in Tomcat looks like that:

       

      server.xml

      <Resource
          name="jms/xaConnectionFactory"
          auth="Container"
          type="org.apache.activemq.ActiveMQXAConnectionFactory"
          description="JMS XA Connection Factory"
          factory="org.apache.activemq.jndi.JNDIReferenceFactory"
          brokerURL="${jms.broker.url}"
          brokerName="LocalActiveMQBroker"
      />
      
      

       

      context.xml

      <ResourceLink name="jms/xaConnectionFactory"
          global="jms/xaConnectionFactory"
          type="javax.jms.XAConnectionFactory" />
      

       

      web.xml

      <resource-env-ref>
          <resource-env-ref-name>jms/xaConnectionFactory</resource-env-ref-name>
          <resource-env-ref-type>javax.jms.XAConnectionFactory</resource-env-ref-type>
      </resource-env-ref>
      

       

      How can I achieve something similar with HornetQ? Or should I choose a different method to link my application with the HornetQ server? I like the built-in JNDI server in HQ, but I'm not sure if I can use it because Tomcat has its own JNDI context which contains for example our databases.

       

      Thanks for your help!

      Stephan