Alex Rudyy created QPID-6635:
--------------------------------

             Summary: Improve JMS Client functionality around Container JNDI 
integration
                 Key: QPID-6635
                 URL: https://issues.apache.org/jira/browse/QPID-6635
             Project: Qpid
          Issue Type: Improvement
          Components: Java Client
            Reporter: Alex Rudyy
            Assignee: Alex Rudyy
             Fix For: 6.0 [Java]


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:

{code:xml}
<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'"/>
{code}

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

# The user needs to reference factory the object factory which is 
AMQConnectionFactory even when they are not interested in connections.
# 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:

{code:xml}
<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>
{code} 


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




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to