Wednesday, March 4, 2009

JMS Redelivery Configuration

I recently had to help a client tune JMS redelivery on rollback. The application would post a message to a Queue with persistence, and a set of MDB's would pull these messages and tries to send them over to another point using Web Services, SMS, Email etc. However, if the sending fails, the requirement is to retry the operation by rolling back the read, so that the redelivery count could be used to discard messages on a threshold, or place them into a dead letter queue for manual action etc.

However, if a redelivery time is not specified, the messages keeps rollingback, and immidiately redelievred, which is of no use whatsoever! Though some JMS providers lets you easily configure this (e.g. WebLogic), I came across a JIRA for ActiveMQ, and a set of links that suggested incapability for JBoss.

It will also be impossible to write a MessageSelector, that is expected to pull only messages with say: (JMS_JBOSS_REDELIVERY_COUNT < 3) OR (JMSRedelivered IS FALSE)etc.

The correct trick, is to set the following properties, when placing the message on the Queue, and let the subscribers simply pull the messages out without any selectors etc..

message.setIntProperty("JMS_JBOSS_REDELIVERY_DELAY", 10000);
message.setIntProperty("JMS_JBOSS_REDELIVERY_LIMIT", 3);

The above correctly delays redeliveries to 10 seconds, with a maximum of 3 redeliveries, until the message is placed into the dead letter queue.

Sunday, March 1, 2009

Logger for Axis2 now available too

I have just uploaded the Logger for Apache Axis2 to the utilities here. See the sample client found here on how to integrate this with a typical Axis2 client. Basically you will need to copy the deployable MAR file into your Axis2 repository/modules directory. Configuration of the module will be via your axis2.xml in the form shown below:

...

<module ref="logger"/>
<moduleConfig name="logger">
<parameter name="rootPath">/tmp/x/y</parameter>
<parameter name="identifier">cfg1</parameter>
<parameter name="enabled">true</parameter>
<parameter name="enableJMX">true</parameter>
</moduleConfig>

...


Connecting via JMX/JConsole allows you to enable/diable the Logger on demand, and can easily be modified to report statistics, response time of the backend service etc.. Let me know how you like this, and what would make this even more helpful

Wednesday, February 25, 2009

Logging all messages passing through Axis

Recently I came across a client who required that all web service calls should be easily logged to a specific path, and grouped by date, and possibly other information. The SOAP stack used was Apache Axis (not Axis2), and thus I wrote a handler that does this..

The source code is in Google [http://code.google.com/p/adroitlogic-utils/] and released under the Apache License v2, so that anyone could use it and modify it as required, and possibly enhance it and send back patches too. The binary for Axis 1.x can be downloaded from [http://adroitlogic-utils.googlecode.com/files/axis-logger-0.1-beta-1.zip]

It can be managed via JMX, and left disabled by default if required, to help troubleshooting problems as they arise. For more details see [http://code.google.com/p/adroitlogic-utils/wiki/AxisLogger] for configuration and usage

Basically, once installed and enabled, this handler would intercept your Axis client side web service calls and save them into a pre-configured directory ordered by date, and other information. This would help comply with requirements for many industries where each request made to external services and the responses received should be logged into files for archival - e.g. airline industry, credit card/payment transactions etc

I hope to include the Axis2 version of this same handler shortly..

Sunday, February 22, 2009

Chaining messages with the Apache Synapse ESB

I've just written a sample that illustrates message chaining with the Apache Synapse ESB here http://adroitlogic.org/knowledge-base-synapse/11-message-chaining-with-synapse.html. This same idea could be used in many different ways to achieve many scenarios, where web service composition etc, is required.

Saturday, November 1, 2008

Ohnoh - Ohloh got it all wrong!

Well its been almost 8 months since I first reported the inability of Ohloh to correctly analyze a codebase of a project.. In-fact, Ohloh knew about this and they stated "This affects a lot of projects, and I desperately want to get this fixed, but it will take some time" [1].. So I checked back in 4 months since there was no progress, and got the attention of Jason - the chief geek at Ohloh. But unfortunately "this problem simply doesn't rank as high as driving & monetizing ohloh adoption" [1].. and there were some "workarounds" which got my attention! However, after many trials by Jason and me, we couldn't get a historical repo created for Synapse, probably because "Apache Svn repo is one single GIANT repo" [1].. but then again.. this is an Apache project! where many open source projects that Ohloh tracks, lives and thrives.

I then questioned the reason for Ohloh to use the "--stop-on-copy" option.. to maybe try to fix the "real" problem, where it "really" occurs.. but no reply from Ohloh.. but some other guy got worked up at this point and said "Just waiting for an answer is enough - The Ohloh boys and girls will work on your issue once they have fixed more important things" [1].., which really got me laughing :)! - You've got to read this yourself here [1].. Then finally, having worked with many open source projects, I thought Ohloh code would/could also be open source, and maybe I could help them fix it!.. but after suggesting that maybe I could help, about a month has now passed, but still no replies from Ohloh.. so I have given up now!

Going back to cool Statsvn, we can see that the Apache Synapse project lived from September 2005 - for over three years! While .. Ohnoh!!.. Ohloh thinks its not even an year old and even shows a yellow triangular warning - suggesting that this could "indicate an immature or volatile project".. I am not exactly sure to which that seems to apply now..

[1] Thread of discussion on Ohloh - https://www.ohloh.net/forums/3491/topics/1326
[2] The correct code statistics for Apache Synapse can be found at [http://people.apache.org/~asankha/synapse/statsvn/]

Monday, June 30, 2008

Webinar on integration with the Open Source WSO2 ESB

Tomorrow Paul, Ruwan and I will be taking users through some interesting integration scenarios based on some real customer deployments, during the "Example integration scenarios with WSO2 ESB 1.7" webinar!

Be sure to register here for it, and the other upcoming webinars on the leading open source enterprise service bus (ESB)

http://wso2.com/about/news/esb-webinar-series-july-08/

Thursday, June 26, 2008

WSO2 Enterprise Service Bus (ESB) Webinar series

The WSO2 Enterprise Service Bus (ESB) team will be conducting a series of webinars, that will introduce some of the new features of the WSO2 ESB 1.7, common integration scenarios, the support for Financial messaging with FIX and complex event processing

Be sure to register! More details from: http://wso2.com/about/news/esb-webinar-series-july-08/