Open Source Adventures
Friday, September 25, 2009
JMSTester online
Essentially it is designed to run a set of distributed JMS clients with a defined load profile. The framework will then measure the throughput and also allows to measure key performance indicators via JMX or on the OS level during the benchmark. This gives nice hints, whether the JMS server machines are CPU bound, lack IO capacity or have to less memory etc.
For all metrics graphs are created and if you want to run even more sophisticated analysises, all metrics are pushed into a CSV file that can be used in your favorite spreadsheet calculator.
The JMSTest framework is now a public project at FUSE Source.
Have fun trying it out if you want, any feedback is more than welcome.
Wednesday, September 2, 2009
Enabling Security for ActiveMQ web apps
From the ActiveMQ web console documentation we could see that we need 3 things:
- An User Realm that can be plugged into the Jetty engine.
- Credentials definitions.
- A security aware web application.
Let's have a look at each of these things:
We start with rewriting the jetty bean definition in the default activemq.xml with the following activemq.xml:
<!-- |
Next you need to create the file webconsole.properties in the conf directory of ActiveMQ.The file contains one line per user with the format
useName: password, [roleName]* |
For example:
myAdmin: THESECRET, amqAdmin |
Finally you need to amend the web.xml files of the ActiveMQ web applications (${activemq.base}/webapps/*/WEB-INF/web.xml) with the following xml fragment:
<security-constraint> |
Make sure, the Realm name matches the one you have set in the Realm definition and the role name match roles you have named in the properties file.
Friday, March 27, 2009
Live from Apache Con in Amsterdam
I am writing this entry as I am sitting at Apache Con in Amsterdam. It is a really good conference with good and plenty information around evrything that is currently going on in the Apache community. In the middle of the conference Ade and I had 6 sessions in total where we discussed the activities of the FUSE team in the Apache community, especially focussing on the FUSE ESB (Apache ServiceMix), the FUSE Message Broker(Apache ActiveMQ) and the FUSE Services Framework (Apache CXF).
It was surprising to me the it was relatively unknown in the community that the FUSE of PROGRESS employs so many active committers and the conference was a god place to explain what we are doing. I have made my presentations available at the ApacheCon web site and we will put them on the FUSE web site as well.
Enjoy reading...
Better Diagnosis for ActiveMQ
Over the last couple of weeks I was involved in a number of projects where we had to understand how messages are being handled within an ActiveMQ broker. Browsing the ActiveMQ code I found the LoggingBrokerPlugin that did some rudimentary logging upon message sends.
That seemed to be a good point to have a little enhancement to ActiveMQ itself. ActiveMQ basically provides a framework for writing plugins that can hook into the message processing within the broker. Usually such a plugin extends the BrokerFilter class.
As there is a whole lot of events it made sense to categorize the events into certain classes to prevent the log files being flooded with unnecessary information. I have finally contributed a patch to ActiveMQ that provides this kind of functionality.
In a nutshell, the plugin can be attached to the broker via the normal ActiveMQ XML configuration :
|
With the configuration above and a logger assigned to org.apache.activemq.broker.util.LoggingBrokerPlugin in the log4j settings you will
see log entries whenever a JMS client connects to or disconnects from the broker and when a session is created/closed by these clients. Other
event classes include transaction events, consumer events and producer events. The internal event group is some kind of a catch all group
that produces log entries for methods that are only of interest for debugging.
As a side note, the methods in the plugin also provide excellent entry points for debugging in to the broker behavior.
Thursday, January 8, 2009
Limiting disk store usage with Active MQ
This week I have been onsite with Gary Tully, one of my colleagues from our Dublin office. We were visiting a customer having a very simple sounding requirement for Active MQ. His company contributes contents to various web pages and portals all over the internet and
he has a Tomcat infrastructure in place for providing the content. The next step is to note
whether a visitor to a site has recently visited other pages where he also provided some content.
The asynchronus link between the web application and the database is realized using the Fuse release of Active MQ 5.2. One requirement that sounded very odd in the beginning was to use persistent messages, but at the same time allow to drop messages in cases of heavy load. Translated that basically means to gather as much statistical data as possible, but it doesn't matter if we can't keep up with the load entirely.
Now what has this to do with messaging and ActiveMQ? - Well, we have a quite typical slow consumer problem here. We are producing messages much faster than we can consume them, because creating a message is more or less a string concatenation while consuming the message involves a database insert. As a result any buffer - on disk or in memory - might be filled up during longer periods of high traffic. The normal messaging behavior - also with ActiveMQ - is to slow down the message producer so that the consumers get a chance to catch up and ensure that no message is lost. In our case that would mean that the response times for delivering the content would decline, which should not happen. The solution we are looking for is to give the message broker a well defined amount of space for buffering messages and simply throw back an exception when the buffer is full.
That sounds easy enough and we were thinking along the lines of putting in place a proper system usage section in the broker configuration. We started looking at the default activemq.xml that is provided with an ActiveMQ download and in there we found the following section:
<systemUsage> |
The memory usage is easy enough to understand and from Gary I learned, that the temporary storage is used for spooling out messages that have been sent
NON_PERSISTENT
while the storage is used for those messages that have been sent PERSISTENT
. As we were sending only persistent messages to keep as much of the statistical data as possible even in case of broker restarts we simply modified the storage section.To turn the behavior in case of reaching the buffer limits, the systemUsage xbean understands a boolean property sendFailIfNoSpace
. Setting this to true should simply throw a JMSException
instead of blocking the send call.
As a result, it is important to explicitly specify a persistence adapter within the configuration file and reference it from the broker and the storage definition as shown in the configuration below.
<beans> |
One caveat in the set up is to make sure that the
maximumFileLength
defined in the persistence adapter is less than half the maximum storage size. Otherwise only one data file is used by the underlying store and that will never get cleaned up. Having maximumFileLength set correctly ensures that we will have at least 2 data files.When we finally were on our way home we decided that we need to get our findings in writing so that we could reference it in the future. I am working with Gary to get the test cases we produced and the configuration files we created into the ActiveMQ project.
Going Live at Apache Con EU 2009
In a session called Distributed Team Building we will have a closer look at developing a distributed application based on an Enterprise Service Bus. As the components and services are developed quite independently from each other,the specification for each component and it's documentation must be fit for retrieval and reuse. New challenges for development teams include knowledge sharing and knowledge reuse as well as shorter and more agile development iterations. Teams also have to overcome their fears when it comes down to changing their way of working. We will have a look at some strategies to address those challenges and overcome the fears in order to compose a team working successfully in an agile and distributed environment.
Another session called Servicemix Topologies has been inspired by the work I have done for a large retail chain in Europe. For that company I had to deploy round about 2000 containers collaborating with each other across eastern Europe. So in this talk we will look at some deployment topologies for ESB applications based on Apache ServiceMix. To illustrate the topologies we will deploy a sample application into various constellations and discuss the pro's and con's of each approach. Especially we will look at fail over and load balancing capabilities, throughput, deployment complexity and discuss the packaging of an application feasible for distributed deployment. Finally we will come up with a potential approach for deploying such a distributed retail application with Apache ServiceMix.
Finally we will turn to the topic of Tooling for ServiceMix where we will walk through the development and deployment of a sample application based on Apache Service Mix 4. After a short overview of the Service Mix 4 architecture and principles we will use the Eclipse based FUSE Integration Designer to design and implement a sample workflow. We will then package this workflow up into OSGi bundles and demonstrate how to deploy those via a central Maven repository into a given Service Mix instance instance.
Hope to see you in Amsterdam.
Thursday, October 16, 2008
Start of the adventure
after having read Blogs on the web for a while I am now down to writing my own. I thought it might be nice to introduce myself first before I get into the topic of Open Source adventures.
My name is Andreas Gies and I currently work as a Principal Architect for PROGRESS Software. As some of you may know, PROGRESS recently acquired IONA Technologies. With that acquisition a large portion of open source technologies came to the footsteps of PROGRESS Software and not surprisingly a section of our consulting force will concentrate on those technologies.
Before the acquisistion I was working mainly with the PROGRESS ESB and a specialist for large scale deployments. The tool of choice to manage project complexity for me was Maven and over the last 3 years I have spent a lot of time writing a suite of Maven plugins addressing various topics in that area: packaging applications fit for distributed deployments and deploying the applications to their distributed runtimes using a "Model driven deployment" approach.
As Maven has brought me to the side of Open Source and I knew all the IONA guys from my past (I was at IONA before joining PROGRESS) it was only natural to become a member of the team dedicated to the Open Source Technologies.
Given my background on ESB based architectures, middleware and deployment I will concentraIn my Blog foremost on Apache ServiceMix, ActiveMQ with it's most interesting Camel subproject and deployment strategies. The start will be slow as I need to get my head around those projects first and I hope readers new to those technologies will benefit from that. As ServiceMix and I get along better and better, may be we can address more advanced topics as well.