You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Hiranya Jayathilaka (JIRA)" <ji...@apache.org> on 2010/12/01 22:40:11 UTC

[jira] Updated: (TRANSPORTS-1) JMSSender executes unnecessary JNDI lookups

     [ https://issues.apache.org/jira/browse/TRANSPORTS-1?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hiranya Jayathilaka updated TRANSPORTS-1:
-----------------------------------------

    Attachment: TRANSPORTS-1.patch

The attached patch solves the problem of JMS sender making unnecessary JNDI lookups when sending requests out. It avoids the JMSOutTransportInfo doing lookups in the constructor. Therefore with this patch EPRs like "jms:/dynamicQueues/Foo?transport.jms.ConnectionFactory=default" also work (verified with ActiveMQ).

In addition this patch also makes sure that all InitialContext objects created by the JMSOutTransportInfo are properly cleaned up.

> JMSSender executes unnecessary JNDI lookups
> -------------------------------------------
>
>                 Key: TRANSPORTS-1
>                 URL: https://issues.apache.org/jira/browse/TRANSPORTS-1
>             Project: Axis2 Transports
>          Issue Type: Bug
>          Components: JMS
>            Reporter: Andreas Veithen
>            Priority: Minor
>             Fix For: 1.1.0
>
>         Attachments: TRANSPORTS-1.patch
>
>
> JMSSender contains the following code:
> jmsOut = new JMSOutTransportInfo(targetAddress);
> // do we have a definition for a connection factory to use for this address?
> jmsConnectionFactory = getJMSConnectionFactory(jmsOut);     
> if (jmsConnectionFactory != null) {
>     messageSender = new JMSMessageSender(jmsConnectionFactory, targetAddress);
> } else {
>     ...
> }
> The constructor of JMSOutTransportInfo will create a new InitialContext and lookup the destination from JNDI. If a connection factory definition is found (jmsConnectionFactory != null), this is unnecessary because the JMSMessageSender constructor will also create a new InitialContext (or reuse a cached one) and carry out the JNDI lookup again.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org