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(
at org.wso2.andes.client.AMQSession.registerConsumer(
at org.wso2.andes.client.AMQSession.access$500(
at org.wso2.andes.client.AMQSession$4.execute(
at org.wso2.andes.client.AMQSession$4.execute(
at org.wso2.andes.client.AMQConnectionDelegate_8_0.executeRetrySupport(
at org.wso2.andes.client.AMQConnection.executeRetrySupport(
at org.wso2.andes.client.failover.FailoverRetrySupport.execute(
at org.wso2.andes.client.AMQSession.createConsumerImpl(
at org.wso2.andes.client.AMQSession.createConsumer(
at org.apache.axis2.transport.jms.JMSUtils.createConsumer(
at org.apache.axis2.transport.jms.ServiceTaskManager$MessageListenerTask.createConsumer(
at org.apache.axis2.transport.jms.ServiceTaskManager$MessageListenerTask.getMessageConsumer(
at org.apache.axis2.transport.jms.ServiceTaskManager$MessageListenerTask.receiveMessage(
at org.apache.axis2.transport.jms.ServiceTaskManager$
at org.apache.axis2.transport.base.threads.NativeWorkerPool$
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
at java.util.concurrent.ThreadPoolExecutor$

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 '' 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 '' 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!