Friday, March 16, 2007

Open ESB & GlassFish: JMS messaging (part 1)

In my last post Open ESB & GlassFish: Getting Started I provided information on our SOA Lab as well as history behind why we selected Open ESB & GlassFish to test in the lab. This post I describe my experience with trying to implement the first step in our use case, JMS messaging between a Alert System running in a Geronimo application server and a BPEL process running in GlassFish.

My goal is to build a BPEL process that can send and receive JMS messages with the Alert System running in a separate and different application server. Sounds pretty straight forward and nothing new for even the "greenest" of SOA products. However, there one little detail that doesn't make this so simple...the message queue implementation is ActiveMQ running in Geronimo.

So I figured I'd first "ease" my pain with this implementation by walking through a tutorial "Step by Step toward a jms sample in NetBeans and yes GlassFish" on Masoud Kalali's Blog...and to no one's surprise, it worked. In all fairness, it turned out to be a good and informational tutorial. Masoud's approach was to:
  1. Configure the internal GlassFish JMS implementation
  2. Develop a Message-Driven Bean (MDB) to pop messages off a queue
  3. Develop a web-based JMS client application that would put messages on a queue
The sample was quite simple and easy to build, deploy and test. However, remember my first blog post (Let the Journey Begin), I mentioned that "...we are not satisfied with just stepping through scripted tutorials of basic examples that the SOA product vendors offer." This is a good example. Masoud's sample works very nicely however, it's using GlassFish JMS implementation, the MDB is deployed in the same GlassFish application server and the web-based JMS client application is (yet again) deployed in the same GlassFish application server.

Ok, at this point I feel I'm ready to implement the first step in the use case. I have the VE (Virtual Enterprise) running in a Geronimo application server that uses ActiveMQ. The Alert System running in Geronimo is placing messages on an ActiveMQ queue. After doing some research and talking with my colleague Steve Smith (who is working with CapeClear on implementing the same use case), I came up with the following approach:
  1. Configure a ActiveMQ resource adapter in GlassFish. I referenced the steps in the Sun Java System Application Server docs for Foreign JMS Providers
  2. Change the MDB annotations to map to the remote ActiveMQ queue
  3. Test with the Alert System running in Geronimo
Well I was able to successfully configure the ActiveMQ resource adapter in GlassFish. The MDB deployed just fine with the changes to the annotations to map to the remote ActiveMQ queue however, messages are not being pop off the ActiveMQ queue. Interestingly enough, I can use the web-based JMS client deployed in GlassFish to put messages on the remote ActiveMQ through the resource adapter in GlassFish. So, I believe the resource adapter is configured properly but my MDB is still having "issues."

I'm real close but not there yet. To top it off, I've had to temporarily "shelf" the Open ESB & GlassFish project and focus on Sun Java CAPS. We were fortunate enough to get some Sun training on Java CAPS and we've decided to implement the use case in the SOA lab since Java CAPS is still fresh in our minds. As much as I hate to leave a problem unresolved, I have to in this case but I WILL come back to it.

...my next post will be on the Sun Java CAPS SOA product tools in our lab.

Thursday, March 15, 2007

Open ESB & GlassFish: Getting Started

The SOA Lab
Before I start talking about my experience so far with Open ESB & GlassFish let me set the stage by introducing the SOA Lab. First a special thanks to my colleague Steve Smith for blogging about a key piece of the SOA Lab and that is The Virtual Enterprise...less work for me :-). I recommend reading The Virtual Enterprise post first to get a better understanding of systems/applications that make up the VE and their interfaces. The SOA Lab is a reference architecture with the VE representing business systems and at its core is a "pluggable" component for swapping in SOA products. This provides us with an environment for evaluating SOA products, learning and performing proof-of-concepts. Ok, now that you have at least a high-level understanding of the lab lets move on.

Open ESB & GlassFish - Why?
We recently starting looking at Open ESB & GlassFish after a potential client inquired about our knowledge and experience with the products. We had identified the need to evaluate an open source SOA project but didn't select one right away. We thought that it would either ServiceMix or Mule (which we already had experience with and is a key component of the VE). Both ServiceMix and Mule are on the radar for the lab but not in our current iteration. So, knowing very little about Open ESB & GlassFish I started my research.

After spending some time on the GlassFish community website (https://glassfish.dev.java.net/) things started coming together for me. GlassFish is a Java EE 5 application server that is "...based on the source code for Sun Java System Application Server PE 9 donated by Sun Microsystems and TopLink persistence code donated by Oracle." The project is getting plenty of support from Sun and Oracle, not to mention, more than 100 contributers in the community. So, it appears that we have a mature and robust application server with good support.

Ok, so what is Open ESB? A quick google turned up its community website (https://open-esb.dev.java.net/). After spending some time on the website I'm coming to the understanding that Open ESB is a service bus based on Java Business Integration (JBI). What is very interesting is that Java EE 5 SDK now includes a subset of functionality (JBI runtime, a BPEL 2.0 Service Engine, and a SOAP binding component) from Open ESB.

So far I like what I'm reading, however, as my colleague Tom would say..."the devil is in the details." My next question is what tools do I use to build Open ESB composite application? Well good news for NetBeans IDE fans, there is a NetBeans Enterprise Pack for NetBeans 5.5 that includes nice tooling for creating BPEL processes graphically. I haven't spent a whole lot of time with the tools, but they do seem to be pretty good. The downside is that if you're IDE of choice is not NetBeans then you're out of luck. I'm not aware of Open ESB support any other IDE...after all this is a Sun supported project :)

Ok, I've liked what I've read so far and even though I haven't used NetBeans for a while I'm open to other IDEs so that doesn't bother me. It's settled, we've decided to select Open ESB & GlassFish as our first open source SOA project to evaluate in the SOA Lab.

...the next post I'll discuss my experience with JMS support in GlassFish to integrate with the Alert System in our VE, which is the first step in our business use case.