Hi Folks, When configuring ESB JMS transport parameters (JMSSender and JMSListener) for Topics with durable subscription I came across following scenario. If we define single TopicConnectionFactory in axis2.xml as follows,
<parameter name="myTopicConnectionFactory" 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">TopicConnectionFactory</parameter> <parameter name="transport.jms.ConnectionFactoryType" locked="false">topic</parameter> <parameter name="transport.jms.SessionTransacted" locked="false">true</parameter> <parameter name="transport.jms.SessionAcknowledgement" locked="true">CLIENT_ACKNOWLEDGE</parameter> <parameter name="transport.jms.SubscriptionDurable" locked="false">true</parameter> <parameter name="transport.jms.DurableSubscriberClientID" locked="false">myTopicDurableClient1</parameter> <parameter name="transport.jms.DurableSubscriberName" locked="false">myTopicDurableSubscriber1</parameter> </parameter> and then refer this connection factory from multiple proxy services (Listeners) then all will share the same client ID which causes ESB to continuously throw the following exception as it trying to reconnect to the same client ID. [2013-05-09 11:01:15,653] ERROR - NativeWorkerPool Uncaught exception org.apache.axis2.transport.jms.AxisJMSException: Error acquiring a JMS connection to : TopicConnectionFactory using JNDI properties : {java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory, serviceType=proxy, transport.jms.ConnectionFactoryType=topic, transport.jms.DestinationType=topic, transport.jms.ConnectionFactory=myTopicConnectionFactory, java.naming.provider.url=tcp://localhost:61616, transport.jms.SessionAcknowledgement=CLIENT_ACKNOWLEDGE} at org.apache.axis2.transport.jms.ServiceTaskManager.handleException(ServiceTaskManager.java:1000) at org.apache.axis2.transport.jms.ServiceTaskManager.access$700(ServiceTaskManager.java:50) at org.apache.axis2.transport.jms.ServiceTaskManager$MessageListenerTask.createConnection(ServiceTaskManager.java:835) at org.apache.axis2.transport.jms.ServiceTaskManager$MessageListenerTask.getConnection(ServiceTaskManager.java:697) at org.apache.axis2.transport.jms.ServiceTaskManager$MessageListenerTask.receiveMessage(ServiceTaskManager.java:496) ........................... Caused by: javax.jms.InvalidClientIDException: Broker: localhost - Client: myTopicDurableClient1 already connected from /127.0.0.1:52919 at org.apache.activemq.broker.region.RegionBroker.addConnection(RegionBroker.java:243) at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:85) at org.apache.activemq.advisory.AdvisoryBroker.addConnection(AdvisoryBroker.java:66) at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:85) at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:85) ............................. This happens because DurableSubscriberClientID and DurableSubscriberName should be unique for a subscriber. But this mis-configuration causes ESB performance downgrade in general (ie - ESB web console to perform sluggish) . So since it is obvious that Client ID must be uniquely defined and no point of continuous reconnection as result will be the same until it is reconfigured. So isn't it better to implement a fail safe scenario for this such as, 1. Terminating deployment of the proxy services 2. limit the reconnection attempts 3. Internally generate unique Client ID if there is a conflict Thanks, Malith -- Malith Dhanushka Software Engineer *WSO2, Inc. : wso2.com* lean.enterprise.middleware. *Blog* : mmalithh.blogspot.com *Linked-i*n : http://lk.linkedin.com/in/malithd *Twitter* : https://twitter.com/MalithWD *Mobile* : +94 716 506 693
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev