You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rampart-dev@ws.apache.org by "Andreas Veithen (JIRA)" <ji...@apache.org> on 2010/03/20 19:17:27 UTC

[jira] Commented: (AXIS2-4658) Caching InitialContexts in JMS transport sender

    [ https://issues.apache.org/jira/browse/AXIS2-4658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12847800#action_12847800 ] 

Andreas Veithen commented on AXIS2-4658:
----------------------------------------

I see three issues with this change:

1. There is a known problem (WSCOMMONS-467) in the JMS sender that causes it to do unnecessary JNDI lookups. Before introducing changes to optimize JNDI lookups, we should first address the fundamental problem and make sure that the transport only does the lookups that are really necessary.

2. Caching initial contexts by EPR doesn't make sense. An EPR refers to a single connection factory and a single destination. Instead of caching the context, the transport should cache these two objects so that the JNDI lookup can be avoided entirely.

3. JMSConnectionFactory already caches the JNDI context. It is not clear why we would need another level of caching.

> Caching InitialContexts in JMS transport sender
> -----------------------------------------------
>
>                 Key: AXIS2-4658
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4658
>             Project: Axis2
>          Issue Type: Improvement
>          Components: transports
>            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: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org