Thursday, July 25, 2013

Providing Dynamic Queue Support when Intergating WSO2 Message Broker with Other Products


WSO2 Message Broker can be integrated with many other WSO2 products like WSO2 Enterprise Service Bus, Application Server and Data Services Server etc. via JMS transaport. Previously, when starting the integrated product (say WSO2 Application Server) after connecting with the Message Broker, the following exception might happen continuously.

ERROR {org.apache.axis2.transport.base.threads.NativeWorkerPool} - Uncaught exception
java.lang.UnsupportedOperationException: The new addressing based sytanx is not supported for AMQP 0-8/0-9 versions
at org.wso2.andes.client.AMQSession_0_8.handleAddressBasedDestination(AMQSession_0_8.java:572)
at org.wso2.andes.client.AMQSession.registerConsumer(AMQSession.java:2838)
at org.wso2.andes.client.AMQSession.access$500(AMQSession.java:117)
at org.wso2.andes.client.AMQSession$4.execute(AMQSession.java:2031)
at org.wso2.andes.client.AMQSession$4.execute(AMQSession.java:1997)
at org.wso2.andes.client.AMQConnectionDelegate_8_0.executeRetrySupport(AMQConnectionDelegate_8_0.java:305)
at org.wso2.andes.client.AMQConnection.executeRetrySupport(AMQConnection.java:621)
at org.wso2.andes.client.failover.FailoverRetrySupport.execute(FailoverRetrySupport.java:102)
at org.wso2.andes.client.AMQSession.createConsumerImpl(AMQSession.java:1995)
at org.wso2.andes.client.AMQSession.createConsumer(AMQSession.java:993)
at org.apache.axis2.transport.jms.JMSUtils.createConsumer(JMSUtils.java:642)
at org.apache.axis2.transport.jms.ServiceTaskManager$MessageListenerTask.createConsumer(ServiceTaskManager.java:871)
at org.apache.axis2.transport.jms.ServiceTaskManager$MessageListenerTask.getMessageConsumer(ServiceTaskManager.java:741)
at org.apache.axis2.transport.jms.ServiceTaskManager$MessageListenerTask.receiveMessage(ServiceTaskManager.java:498)
at org.apache.axis2.transport.jms.ServiceTaskManager$MessageListenerTask.run(ServiceTaskManager.java:420)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

The reason for this annoying error log is, when WSO2 MB is integrated with some other product, at the server start up it tries to create a Queue in MB for each deployed service in other product (WSO2 AS in this case), with the corresponding service name. However since there was no dynamic queue support previously, it refers the 'jndi.properties' file in <Carbon_Home>/Repository/conf folder and see whether a queue with given service name is defined. When it is not defined there, the server will be throwing following exception.

With the current dynamic queue support there is no need to define the queue/topic names as it will be not limited to a 'jndi.properties' file and all the queues for available services will be created on the fly. This feature is supported via Axis2-JMS-Transport and WSO2 ESB 4.6.0, AS 5.1.0 and DSS 3.0.1 uses axis2-transport-jms_1.1.0.wso2v7 version. Since the jms transport version, axis2-transport-jms_1.1.0.wso2v8 which facilitates dynamic queues has not been released yet, to have these changes you need to replace the axis2-transport-jms library in <Carbon_Home>/Repository/components/plugins with axis2-transport-jms_1.1.0.wso2v7.jar file added in this location. However the new versions of WSO2 products will be shipped with axis2-transport-jms_1.1.0.wso2v8 version and there afterwards there is no need to do the above replacement.

The following are the new versions which will facilitate dynamic queue support with WSO2 MB by default.

Note: According to the Message Broker roadmap, 'Dynamic Queue Support' will be officially provided with MB 3.0.0 version which will be released in early next year. Therefore this is not the final verified implementation of this feature, however 

WSO2 ESB 4.7.0 : Already Released, You can go to this doc to see the integration guide.

WSO2 AS 5.2.0 : Will be released soon, find the integration guide for AS 5.1.0 here.

WSO2 DSS 3.0.2 : Will be released soon, find the integration guide for DSS 3.0.1 here.

1 comment:

  1. Hi Ishara,

    Appreciate for writing this blog. It really helped me after copying the attached file to the plugins folder. I am using WSO2ESB 4.6.0 and I used to get the same exception during start up.

    Thanks for the fix!

    ReplyDelete