Friday 17 April 2009

If you are using OSGi then give Pax Exam a try

Pax Exam is a great piece of work! It makes it super easy to write JUnit4 tests which can then be run in multiple OSGi containers like Felix & Equinox using the exact bundles you require - plus it lets you inject BundleListener and so forth. Here's the tutorial which should get you started pretty quick.

I recently added an OSGi integration test to Apache Camel, here's the test case if you're interested. Notice how the versions of the bundles added to Felix and Equinox are not mentioned in this test case - they are inherited from the pom.xml from Maven.

The depends-maven-plugin from ServiceMix Kernel (soon to be Apache Karaf) generates the file target/classes/META-INF/maven/dependencies.properties which Pax Exam can then use to resolve the version dependencies of groupId/artifactIds. This lets you keep all your version information in your pom.xml and avoid having to update all your test cases whenever your pom.xml changes - keeping things nice and DRY!

Great stuff Pax-folks, keep up the good work!

Wednesday 1 April 2009

Apache Camel switching from Java to BPEL, WSDL and RDF XML (with some XSLT)!

The Apache Camel team has always strived to make complex integration challenges as easy as possible connecting pretty much all transports, protocols and middleware together easily using any of the enterprise integration patterns typically in a single line of Java code.

However our users have often said that Java is way too complex to understand. So to tackle that need we're dropping support for Java due to its complexity and instead we're switching to a combination of BPEL, WSDL and RDF XML Syntax instead (with maybe some XSLT too).

We're hopeful that a single XML document with 6 or 7 namespaces along with 2 or 3 spring ones should just about be able to route from one endpoint to another in a similar way to using a line of Java code - but using all the power of the various XML specifications; making it easy to add any WS-* specifications you fancy too!

One downside of this approach is that the XML header to define all the namespaces and their prefixes is about page or so of text but we're hoping a netbeans plugin will be completed soon that just hides the first page of your XML - making development much more agile!

We've also got a signed CLA on file so we can reuse Opera's new face gestures technologies to help typing in all those pointy brackets and XML namespaces; while giving yourself a great face workout at the same time. Agile integration and fitness in one!

More detailed design notes are available here from our new technical architect on the project.

Go Camel! :)