[ 
https://issues.apache.org/jira/browse/TRANSPORTS-12?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12965584#action_12965584
 ] 

Hiranya Jayathilaka commented on TRANSPORTS-12:
-----------------------------------------------

I believe the problem is with the InitialContext created in the 
JMSOutTransportInfo class. This doesn't seem to get cleaned up ever. With 
certain JMS brokers this leads to catastrophic results.

Regarding your point 2 and 3, please note that JMSConnectionFactory will not 
come into the picture unless the user has defined any in the Axis configuration 
under the JMS transport sender.

I would like to spend some time on this issue and get it fixed properly. Will 
send in a patch soon.




> Caching InitialContexts in JMS transport sender
> -----------------------------------------------
>
>                 Key: TRANSPORTS-12
>                 URL: https://issues.apache.org/jira/browse/TRANSPORTS-12
>             Project: Axis2 Transports
>          Issue Type: Improvement
>          Components: JMS
>            Reporter: Rajika Kumarasiri
>         Attachments: AXIS2-4658.patch, AXIS2-4658.patch
>
>
> When using the JMS transport sender for sending messages  to external broker 
> it creates InitialContext per message. This is actually unnecessary since we 
> can cache and use the same intialContext., and also some brokers behave 
> strangely when re-creating the initialContext. This patch cache the 
> InitalContext using the EPR as the key. User can specify to use caching using 
> the property "transport.jms.CacheInitialContext" set to true. Synchronization 
> has done as required since creating InitialContext is not thread safe and 
> also JNDI look up. 
> User has to define an Initial Context definition in the JMSTransport sender 
> configuration as follows. 
> <transportSender name="jms" class="org.apache.axis2.transport.jms.JMSSender">
>         <parameter name="default" locked="false">
>               <parameter name="java.naming.factory.initial" 
> locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
>               <parameter name="java.naming.provider.url" 
> locked="false">tcp://localhost:61616</parameter>
>               <parameter name="transport.jms.ConnectionFactoryJNDIName" 
> locked="false">QueueConnectionFactory</parameter>
>               <parameter name="transport.jms.ConnectionFactoryType" 
> locked="false">queue</parameter>
>               <parameter name="transport.jms.CacheLevel">producer</parameter>
>                 <parameter 
> name="transport.jms.CacheInitialContext">true</parameter>
>         </parameter>
> </transportSender> 
> A related discusstions also can be found here: 
> http://wso2.org/forum/thread/9281
> Some of the improvements in this patch was suggested by Paul Inglis who also 
> submitted the patch for issue - 
> https://issues.apache.org/jira/browse/AXIS2-4625 

-- 
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to