Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-6635

Improve JMS Client functionality around Container JNDI integration

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • qpid-java-6.0
    • JMS AMQP 0-x
    • None

    Description

      Current implementation of AMQConnectionFactory implements javax.naming.spi.ObjectFactory. This allows the JMS Client to integrate into external JNDI containers such as Tomcat. At the moment, user can register in external JNDI Qpid BURL-based destinations, connection factories and even connections.

      Sample configuration is:

      <Resource name="jms/connectionFactory" auth="Container"
                  type="org.apache.qpid.client.AMQConnectionFactory"
                  factory="org.apache.qpid.client.AMQConnectionFactory"
                  org.apache.qpid.client.AMQConnectionFactory="amqp://guest:guest@clientid/?brokerlist='localhost:5672'"/>
       <Resource name="jms/queue" auth="Container"
                  type="org.apache.qpid.client.AMQQueue"
                  factory="org.apache.qpid.client.AMQConnectionFactory"
                  org.apache.qpid.client.AMQQueue="direct://amq.direct//myDurableQueue?durable='true'"/>
      

      Currently implementation risks surprising/confusing in a couple of ways:

      1. The user needs to reference factory the object factory which is AMQConnectionFactory even when they are not interested in connections.
      2. The mechanism used to pass arguments to the factory into using the full qualified target class name as an attribute.

      In addition, the implementation does not support ADDR style addresses nor the new PoolConnectionFactory..

      For comparison, ActiveMQ's is slightly more intuitive:

      <Context>
          ...
        <Resource name="jms/ConnectionFactory" auth="Container" type="org.apache.activemq.ActiveMQConnectionFactory" description="JMS Connection Factory"
              factory="org.apache.activemq.jndi.JNDIReferenceFactory" brokerURL="vm://localhost" brokerName="LocalActiveMQBroker"/>
          ....
      </Context>
      

      We can extend that and implement the following:

      • allow registering in external JNDI PoolledConnectionFactory
      • user more user friendly address type names for Connection URLs and Binding URLs
      • move ObjectFactory into a separate class as it could be confusing from end-user point of you to use AMQConnectionFactory to create instances of AMQConnectionFactory
      • allow address-based destinations to register in external JNDI

      Attachments

        Activity

          People

            kwall Keith Wall
            orudyy Alex Rudyy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: