Sit amet felis. Mauris semper,

Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque sed felis. Aliquam sit amet felis. Mauris semper, velit semper laoreet dictum, quam diam dictum urna, nec placerat elit nisl in quam. Etiam augue pede, molestie eget, ...

Category name clash

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque sed felis. Aliquam sit amet felis. Mauris semper, velit semper laoreet dictum, quam diam dictum urna, nec placerat elit nisl in quam. Etiam augue pede, molestie eget, rhoncus at, convallis ut, eros. Aliquam pharetra. Nulla in tellus eget odio sagittis blandit. ...

Test with enclosures

Here's an mp3 file that was uploaded as an attachment: Juan Manuel Fangio by Yue And here's a link to an external mp3 file: Acclimate by General Fuzz Both are CC licensed. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque sed felis. Aliquam sit amet felis. Mauris semper, velit semper laoreet dictum, ...

Block quotes

Some block quote tests: Here's a one line quote. This part isn't quoted. Here's a much longer quote: Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In dapibus. In pretium pede. Donec molestie facilisis ante. Ut a turpis ut ipsum pellentesque tincidunt. Morbi blandit sapien in mauris. Nulla lectus lorem, varius aliquet, ...

Contributor post, approved

I'm just a lowly contributor. My posts must be approved by the editor.Mauris semper, velit semper laoreet dictum, quam diam dictum urna, nec placerat elit nisl in quam. Etiam augue pede, molestie eget, rhoncus at, convallis ut, eros. Aliquam pharetra. Nulla in tellus eget odio sagittis blandit. Maecenas at ...

Posted by The Java Monkey - - 7 comments



Axis 2 is an enterprise solution for an enterprise problem - Service Oriented Architectures. When running Axis 2 over the standard HTTP/S transports it is excellent. However, when running it over JMS, it has a major shortcoming (as of Axis 2 1.3).

The key feature of a system based around messaging is that messages must be 100% guaranteed to reach their destination. In the SOA world, this is handled via the Durable Subscriber enterprise integration pattern. A durable subscription instructs the messaging server to save messages, that are published while a subscriber is inactive. When the subscriber reconnects to the messaging server, the subscriber receives all the messages that it missed while it was inactive. This is a standard JMS feature which is one of the key patterns in enterprise integration systems.

Axis 2 1.3, does not support this, so I had to do some custom modifications to the Axis 2 transport layer so that I could make use of durable subscriptions. This blog is about how to configure your Axis 2 to support durable subscriptions, and contains a downloadable jar that contains the modified JMS transport layer for Axis 2 1.3.

Don't Shoot the Messenger!

axis2.xml

I have modified Axis 2 so that the configuration fits in with the standard JMS transport configuration. The following example JMS transport receiver highlights the two new transport receiver configuration parameters. axis2.xml is generally located in the WEB-INF/conf folder of your Axis 2 server.

  1. UseDurableSubscriptions - this speaks for itself.
  2. DurableSubscriptionClientIdentifier - this is a unique identifier that the messaging server uses to identify your specific application server instance (for example, your dev tomcat).

Note that the example transport receiver below is configured to work with Web Sphere MQ, so the JNDI parameters should be changed depending on the messaging platform you are using.



<transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
<parameter name="defaultCF">
<parameter name="java.naming.factory.initial">
com.ibm.mq.jms.context.WMQInitialContextFactory
</parameter>
<parameter name="java.naming.provider.url">
MQSERVER:1421/MY.CHANNEL.SVRCONN</parameter>
<parameter name="transport.jms.ConnectionFactoryJNDIName">
topicCF
</parameter>

<parameter name="transport.jms.UseDurableSubscriptions">
yes
</parameter>
<parameter name="transport.jms.DurableSubscriptionClientIdentifier">
myservice.prod.tomcat
</parameter>

</parameter>
</transportReceiver>

services.xml

The final part of your configuration, is to configure your individual web services to be durable. My implementation is such, that you can have multiple web services and can define per web service, whether it is durable, or runs over HTTP or JMS (or both) or any combination.

The only parameter required for your service definition is, DurableSubscriptionName - this parameter identifies your specific web service uniquely to the messaging server so that when your web service connects to it, it knows what messages you have missed. As soon as you deploy your web service, you will see it start to pull all the messages off MQ that it missed!

If your JMS-enabled web service does not require to be durable, then simply leave this parameter out and it will resort to being a plain-old Axis 2 non-durable JMS service. Any of your web services running over standard message queues should be configured this non-durable way, as durability is only for publish-subscribe.

Note that the following services.xml excerpt is for a web service that is available over both HTTP and JMS and is subscribed to the topic MQ.BOOKING.TOPIC.



<transports>
<transport>jms</transport>
<transport>http</transport>
</transports>

<parameter name="transport.jms.ConnectionFactory" locked="true">
defaultCF
</parameter>
<parameter name="transport.jms.Destination" locked="true">
MQ.BOOKING.TOPIC
</parameter>

<parameter name="transport.jms.DurableSubscriptionName" locked="true">
BOOKING.SERVICE.PROD
</parameter>


Note that I have not modified Axis 2 to have the ability to de-register a web service as a durable subscriber. Also note that durable subscriptions only work for publish-subscribe/asynchronous messaging - it does not work for point-point message queues and never will!

To anyone who is interested, I am also working on a major update to the JMS transport for Axis 2 so that it can heal its connections to messaging servers without having to restart the Axis 2 server.

Distribute Me

The jar file attached to this blog (see below) contains the JMS transport classes I fixed up for Axis 2 1.3 only. These either need to be put into the Axis 2 kernel jar so they take the place of the existing ones, or expanded into the WEB-INF/classes folder of your Axis 2, so they override the versions of these classes in the Axis 2 kernel jar file.

7 Responses so far.

  1. Excellent job!!
    As you have mentioned if you can contribute to Apache I mean Axis2 project that would be a great help.

    Let's do this ,
    1- Create a JIRA in Axis2 project
    2- Attach the changes you have made

    Then one of us (someone from Axis2 developer team), can go though the attachment and then commit the changes to Axis2 trunk

    -Deepal

  2. This is really great! Can we see this soon in Apache?

  3. Good attempt to configure Axis 2 so that the configuration fits in with the standard JMS transport configuration.As more than one year has passed since this post can i know the pdates.Is it really part of Axis2 now?

Leave a Reply

Recent Posts