Wednesday May 21, 2008
Why is OSGi on everyone's tongue - or why you should take the red pill
In a JBoss blog on "OSGi - The placebo that will rejuvenate this industry (just ask your vendor)" Sacha paints a picture of everyone just following the latest buzz-word and (at least in title) not much substance.
So is that really the end of the story?
Hold on, wouldn't that be a really strange story for Sun which had quite a mixed and turbulent affair with OSGi in the past? And now we (as in Sun) are barrelling ahead with native OSGi support in GlassFish v3 as well as Open ESB with Project Fuji... Doesn't seem to make sense that they'd just change their minds for a cheap thrill of name dropping...
I'll admit it now. before digging into it I was very skeptical of OSGi; not that I didn't like the premise of abolishing classpath hell, but oftentimes enterprise quality features come at a large cost of complexity. Also the worry was if the "API" based services of OSGi would mesh well with the message-based, mediated services architecture we require for our SOA / integration platform with lofty goals and a lot to live up to. Project Fuji is all about looking at every aspect of our platform and making it more approachable and flexible, so if a technology doesn't add enough there is no way I'm going to add it.
Now, I'm completely sold. It turns out the OSGi spec does its core job very well and in a very stable fashion; plus it actually is surprisingly straight forward for our platform to take advantage of without being overly intrusive. In fact to start with it only required one minor enhancement (adding some additional entries in the jar's manifest.mf) to make our existing adapters, containters as well as applications run in OSGi enabled environments.
Also it turns out that the current standard for message based, mediated exchanges - Java Business Integration (JBI) - sits very well on top of OSGi and in fact our experiences so far in Project Fuji indicate that the specs add features to each other that really have the potential to bring out the best in both. We simply made our JBI framework implementation an OSGi bundle which then can listen for bundle deployments it should service..
What we gain from OSGi in Fuji
Some of what OSGi currently gains with Fuji
Now also throw in all the capabilities of an application server getting modularized and natively supporting OSGi; as the GlassFish team is doing with GlassFish v3, and Fuji gains even more capabilities it can leverage to add scripting, web container, ejb, comet etc... support; without having to create one huge deployable that you may only use 10% of... (hint: stay tuned for what we're cooking up with GlassFish ESB v3 as well ;) ).
Now with the above said, I don't expect all our users to rush out and learn the deepest ins and outs of OSGi. Just like JBI, I primarily see this as an enabling technology for the platform, only if you want to extend the platform itself would you typically touch it directly. As an example I'd expect users to develop simple scripts or POJOs and for example use Spring DM to consume and provide services; so you inherit the advantages of the platform without necessarily having to explicitly touch the underlying technologies.
Coming back to the original blog I am curious how easy it will be to leverage the OSGi-on-the-side story and "don't use it directly" approach JBoss seems to be talking about so far, I would personally like to see Fuji on top of JBoss with an easy way to natively leverage all it's capabilties in the near future as well :)
Posted at 05:42PM May 21, 2008 by Andreas Egloff in Software Architecture | Comments[4]
Andreas Egloff is the Lead Architect for SOA / Business Integration at Sun Microsystems, Inc.
This is a personal weblog, I do not speak for my employer.
| « July 2009 | ||||||
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 | |
| Today | ||||||
Some application developers like to know how things work under-the-covers even if its not necessary to build their apps.
Can you walk through a simple example so we can see how msgs move between the JBI components and the OSGi bundles?
thanks
J
Posted by Jason on May 23, 2008 at 08:25 AM CDT #
Excellent summary of your experience. Clearly, OSGi technology is not a silver bullet, but for situations where it is beneficial, it can really help a lot.
Posted by Richard S. Hall on May 23, 2008 at 09:15 PM CDT #
Jason, one thing to realize is that the JBI components (or service containers in more generic terms) are OSGi bundles themselves; as is the application deployed to them.
Also, the service bus (normalized message router or NMR in JBI terms) is installed as a JBI bundle. The API "contract" to interact with the service bus is exposed as an OSGi service, hence any bundle can look it up and send or receive messages from it - it actually doesn't have to have to be a JBI component! So any OSGi bundles can participate on the message-based service layer and provide and consume services on it.
So let's say we route message arriving on an FTP server to a JRuby service. The application jar will have a configuration for FTP and a JRuby script with a "process" method. The JBI framework recognizes this kind of OSGi bundle and deploys to the FTP binding and the JRuby engine.
1. When the FTP binding polls a file, it will use the service bus (NMR) contract it obtained from OSGi to send the message.
2. The service bus routes it to the JRuby engine (which also obtained the service bus contract from OSGi and is advertizing a JRuby service endpoint, listening for invocations)
3. The JRuby engine invokes the user's JRuby script with the message
HTH
Andi
Posted by Andi on June 10, 2008 at 02:16 PM CDT #
Is there a service engine for using Spring DM with Fuji?
I have been looking around the web for some time now and it would appear that the only way to get Spring DM working with JBI is via ServiceMix and ServiceMix's Spring SE requires the entire ServiceMix JBI implementation.
Also, from the API it is pretty clear how one can use the FUJI APIs to put messages onto the NMR but it is anything but obvious how to use the service to listen for/consume messages coming from the NMR.
Any chance we can see some concrete examples?
Thanks,
-James
Posted by James Peltzer on June 13, 2008 at 01:37 PM CDT #