Posts

Coming in Karaf 3.0: new KAR service, command, management

We are working hard on Karaf 3.0. This major new version of Karaf will bring a lot of new features and enhancements. KAR in Karaf 2.2.4 As you may know, Karaf 2.2.x already provides “basic” KAR support. A KAR (KARaf archive) is a zip file which gathers a features XML and all bundles and configuration files dependencies. It means that a KAR is an atomic artifact which can be deployed without an Internet connection (as all is shipped in the KAR file itself). In Karaf 2.2.x, the KAR support was: a KAR deployer: you can copy a KAR file into the deploy folder, and KARAF will uncompress the KAR file, and install all features containing in the shipped features XML. a create-kar goal in the features-maven-plugin: this goal reads a features XML and creates a KAR file, ready to be deployed. So, all KAR logics were in the KAR deployer. It means that you are not able to deploy a KAR from a remote URL, etc. What’s coming in Karaf 3.0 The KAR service In Karaf 3.0, the KAR core bundl...

Overview on Apache Karaf, Pax Web, and Camel archetypes

In my previous blog post, I introduced the Karaf Maven plugins. The Karaf Maven plugins are really helpful, starting from an existing POM. If you can write this POM by hand (it’s my favorite way ;)), we also provide several archetypes which create and pre-configure a Maven project for you. Karaf Archetypes The next Karaf release (2.2.5) provides a set of new archetypes: Assembly Archetype The karaf-assembly-archetype create a Maven project which create a custom Karaf distribution. It allows you to create your own Karaf distribution. The project downloads a Karaf standard distribution (in tar.gz and zip formats), unpack it, and create a new distribution. The easiest way to use it is to use the interactive mode: mvn archetype:generate -DarchetypeGroupId=org.apache.karaf.archetypes -DarchetypeArtifactId=karaf-assembly-archetype -DarchetypeVersion=2.2.5-SNAPSHOT Bundle Archetype If basically a bundle is a jar file with some special statement in the MANIFEST, the easiest way to create ...

Do you know the Apache Karaf Maven plugins ?

Apache Karaf is not only an OSGi container, it also provides a set of Maven plugins for tooling. In the next Apache Karaf 2.2.5 release, you will find two Maven plugins: cmdhelp-maven-plugin generates documentation (in DocBook or Scalate format) for Karaf commands features-maven-plugin provides a set of goals to manipulate Karaf features In this blog post, I will cover the features-maven-plugin as I think it’s the most interesting for your life with Karaf. Generate a features XML If I prefer to handle and create the features XML by hand, the features:generate-features-file goal could do it for you. It takes the dependencies of your project (described in the POM), and create the features XML. For instance, in the following example, a features XML file will be generated containing the commons-lang bundle: <xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-inst...

Apache Karaf Cellar and DOSGi

Next version of Apache Karaf Cellar will include a DOSGi (Distributed OSGi) implementation. There are several existing DOSGi implementations: in Apache CXF (powered by the CXF stack), in Fuse Fabric, etc. The purpose of the Cellar one is to leverage the Cellar existing (Hazelcast instance, distributed map, etc), and to be very easy to use. Karaf Cellar DOSGi installation Cellar DOSGi is part of the main cellar feature. To install it: karaf@root> features:addurl mvn:org.apache.karaf.cellar/apache-karaf-cellar/3.0.0-SNAPSHOT/xml/features karaf@root> features:install cellar Distributed services You can note a new command available in Cellar: karaf@root> cluster:list-services It displays the list of services “cluster aware”. It means a service that could be used remotely from another node. Code sample To illustrate the Cellar DOSGi usage, we will use two bundles: the provider bundle is installed on node A and “expose” a distributed service the client bundle ...

ApacheCon NA11 2011: so great

Sad, too early ;). You know this feeling when something great is ended. I was at the ApacheCon NA11, Vancouver this week, and it was simply awesome. I gave two talks: Apache ServiceMix future ( http://people.apache.org/~jbonofre/smx_future.ppt ) Deployment with Apache Karaf and ACE ( http://people.apache.org/~jbonofre/deploy_karaf_ace.ppt ) On the other hand, I attended to the following session: Business and Open Source, open discussion with especially Bertrand (Delacretaz), Debbie (Moynihan), Ross (Turk) Apache, Branding and Trademark, with Shane (Curcuru) Archiva by Brett (Porter) Whirr by Tom (White) DOSGi and cloud by Guillaume (Nodet) I discussed with a lot of people: Of course Dan (Kulp), Hadrian (Zbarcea), Ross (Turk) Guillaume (Nodet), it was really great to work together, discussed about our roadmap for Karaf and ServiceMix, etc. Thanks a bunch Guillaume 😉 Christian (Muller) and Jon (Anstey), we talked about Camel. These guys are so cool 😉 Mohammad (Nour El-Din) about projec...

Apache Karaf moved to OSGi r4.3

Apache Karaf trunk (future 3.0 release) now fully supports OSGi 4.3 release by running Apache Felix framework 4.0.1 and Eclipse Equinox 3.7.1. If this update is just a support update, it gives us the opportunity to see what we can leverage from the OSGi r4 early draft. What’s in preparation in OSGi r4 ? I will not cover the whole OSGi 4 specification. I will just spot some features that will be “key” features in Karaf. New OBR specification (RFC-0112) Currently, there are a number of available solutions to downloading and installing bundles: current OBR stores the bundles and allows users to discover bundles P2 provisioning platform used in Eclipse Maven repositories as used in Karaf Nimble Repositories which are an extension of OBR to deal with active state dependencies The idea is to gather all these concepts into a new OBR specification. The new OBR will be able to: handle bundle fragments dependencies, provide management tooling can use a resolver strategy allowing...

What's new in Karaf 2.2.4 ?

Apache Karaf 2.2.4 has been released this week end. You can take a look on the release notes . More than a bug fixes release, this version includes several new features and enhancements. Command aliases Previously, the osgi:* commands gathered different kind of usage: osgi:start, osgi:stop, etc are related to bundles, osgi:shutdown is related to container itself, and osgi:ls is OSGi service related. To be clearer for the users, new aliases have been introduced. NB: on Karaf trunk (future 3.0.0 release), the commands have been fully renamed (not aliased). system:* The system:* commands are related to the Karaf container itself:   system:shutdown is equivalent to osgi:shutdown and shutdown the Karaf container   system:start-level is equivalent to osgi:start-level and defines the default start-level to consider bundles as system bundles services:* The services:* commands are related to OSGi services: services:list is equivalent to ls and lists the OSGi services available bundles:* T...