Archive for: ‘July 2011’

Website mashup with Apache Camel

July 22, 2011 Posted by jbonofre

Mashup ?

You are browsing on some websites and you see an interesting information, that you want to poll to be used into your system.

Unfortunately, you don’t know the website provider, and you don’t know if a “plug” is provided, for instance a WebService.

So you have to find a way to get the information.

Using Camel

You can create a Camel route looking like:

  <route>
    <from uri="timer:fire?period=2000"/>
    <setHeaders>
        <constant>POST</constant>
    </setHeaders>
    <to uri="http:blog.nanthrax.net?param=value"/>
    <unmarshal>
        <tidyMarkup/>
    </unmarshal>
    <setBody><xpath>//span[@class='date']</xpath></setBody>
    <to uri="log:blog"/>
  </route>

Here, every 2 seconds, we access to blog.nanthrax.net to get the HTML source. We can eventually provide some parameters (with POST method here).
On this HTML, we use tidy markup (from camel-tagsoup component) to cleanup the HTML code and format it in XML.
After that, we extract from the source, only the content of element.
Finally, we send the filtered content into the log.

Apache Karaf 2.1.x branch is in end of life, 2.1.6 available

July 17, 2011 Posted by jbonofre

We (The Apache Karaf team) have decided to switch Karaf 2.1.x branch into End Of Life mode.

We released Karaf 2.1.6 which is the last version on this branch:

http://karaf.apache.org/index/community/download/karaf-2.1.6-release.html

We encourage all users to upgrade to Karaf 2.2.2, which is the latest Karaf stable release.

This announce is in preparation of the next Karaf 3.0.0 on which we are hardly working currently.

Apache Karaf Cellar 2.2.1 Released

July 11, 2011 Posted by jbonofre

Apache Karaf Cellar 2.2.1 has been released today.

Cellar is a Karaf sub-project which aim to provide a clustering solution for Karaf.

Quick start

To enable Cellar into a Karaf, you just have to install the Cellar feature.

First, register the Cellar features descriptor in your running Karaf instance:

karaf@root> features:addurl mvn:org.apache.karaf.cellar/apache-karaf-cellar/2.2.1/xml/features

Now, you can see the Cellar features available:

karaf@root> features:list|grep -i cellar
[uninstalled] [2.2.1 ] cellar Karaf clustering
[uninstalled] [2.2.1 ] cellar-webconsole Karaf Cellar Webconsole Plugin

To start Cellar, install the cellar feature:

karaf@root> features:install cellar

It’s done: your Karaf instance is Cellar cluster ready.

You can see your cluster node ID and, eventually, others cluster nodes:

karaf@root> cluster:list-nodes
No. Host Name Port ID
* 1 node1.local 5701 node1.local:5701
2 node2.local 5702 node2.local:5702

The * indicates your local node (on which you are connected).

You can ping a given node to see how the network behaves:

karaf@root> cluster:ping node2.local:5702
Pinging node :node2.local:5702
PING 1 node2.local:5702 82ms
PING 2 node2.local:5702 11ms
PING 3 node2.local:5702 14ms

Now, if you install a feature, it will be installed on all nodes. For instance, if you install eventadmin feature on node1:

karaf@node1> features:install eventadmin
karaf@node1> features:list|grep -i eventadmin
[installed ] [2.2.1 ] eventadmin karaf-2.2.1

you can see it installed on node2:

karaf@node2> features:list|grep -i eventadmin
[installed ] [2.2.1 ] eventadmin karaf-2.2.1

Cellar groups

In Karaf Cellar, you can define cluster groups. It allows you to select nodes and resources involved in one group.

By default, you have the default group:

karaf@root> cluster:group-list
Node Group
* node1.local:5701 default
node2.local:5702 default

You can create a route, for instance test:

karaf@root> cluster:group-create test
Name test
Members []

 

For now, the group doesn’t have any member:

kaaf@root> cluster:group-list
Node Group
node1.local:5701 default
* node2.local:5702 default
test

We can add a node as a member of a cluster group:

karaf@root> cluster:group-join test node1.local:5701
Node Group
node1:5701 default
* node2:5702 default
node1:5701 test

The node could be local or remote.

Cluster units

Currently, Apache Karaf Cellar is able to manage features and configuration. It’s based on an event-driven model.

It means that Cellar is listening for some events (such as install/start/remove features, or set configuration) and fire the actions on all nodes.

Features

You can list the features of a given group:

karaf@root> cluster:features-list test

The feature events (install, uninstall) are sync between all members of the same cluster group.

Configuration

Cellar is able to manage configuration event, as it does for features.

You can see the configuration PID associated to a given cluster group:

karaf@root> cluster:config-list test
No PIDs found for group:test

You can create a configuration (with a PID) directly into a given group:

karaf@root> cluster:config-propset test my mykey myvalue

Now, we can see this configuration in the cluster memory:

karaf@root> cluster:config-list test
PIDs for group:test
PID
my

and the value in this configuration PID:

karaf@root> cluster:config-proplist test my
Property list for PID:my for group:test
Key Value
mykey myvalue

Now, you can see that the cluster group test doesn’t have any member for now:

karaf@root> cluster:group-list
Node Group
* node1.local:5701 default
test

If I list the configuration on my node1 local instance, my is not known:

karaf@root> config:list "(pid=my)"

Now, node1 join the test cluster group:

karaf@root> config:group-join test node1.local:5701

And, now, the node1.local inherits of the configuration defined in the cluster:

karaf@root> config:edit my
karaf@root> proplist
service.pid = my
mykey = myvalue

Now, time to work 🙂

OK, we have a first release of Karaf Cellar, allowing mainly discovery, group and state replication between Karaf instances. The bundle events support is also quite implemented (it just needs to be finalized).

We are going to add JMX Cellar MBeans and logging message with Mike Van. As Cellar is fully based on Blueprint, adding MBeans should be very easy and quick 🙂

But it’s not enough 🙂

Now, I’m sure you have a question: is it possible to have a kind of shared OSGi services registry, with proxy, and be able (transparently or not) to use a remote service ? Do we have DOSGi support ?

The short answer is: not in Cellar 2.2.1.

But, we are working on these two topics (I name it “distributed service registry” and “transport”) and it should be included the next Cellar releases.

I hope you enjoy this new Karaf sub-project.

I’m now officially Talend employee

July 4, 2011 Posted by jbonofre

After 8 years worked at Fimasys, I decided to move last December.

Fimasys is a great company but not purely middleware oriented (it’s a financial software provider). I was receiving offers from quite long time and I decided to make a choice between Talend and Fusesource.

Both companies are great and I know a lot of amazing guys in each.

The choice was horribly difficult 🙁

On Fusesource side, I was very attracted to work with great guys like Guillaume, James, Hiram, Claus, Gert, Lars, Jon, etc, etc, etc.

On the other hand, the Talend Apache team is awesome: Dan, Hadrian, Sergey, Colm, Glen and Christian. I discovered also great guys from Sopera (Dietmar, Renat, etc, etc) and from DI (Cédric, Rémy, Christophe, etc, etc).

The Talend challenge is really impressive and I decided to join them. It was really hard because I have a deep respect for Fusesource and especially Guillaume.

Finally it’s now official: I’m Talend employee 😉

 

Apache Karaf 2.2.2 available

July 4, 2011 Posted by jbonofre

A new Apache Karaf version is available. If it’s mainly a bug fixes release, it includes some small enhancements.

Especially, we added a completer for shell aliases. It means that you add a new command alias in etc/shell.init.script, the TAB key will look for aliases in addition of pure commands.

Another interesting enhancement used in Apache CXF and Apache Camel is that the feature Maven plugin now “embeds” the Karaf core features. It means that it’s no more required to define <repository>mvn:org.apache.karaf.assemblies.features/standard/2.2.2/xml/features</repository> in your features descriptors: it’s the default.

You can take a look on the complete release note.

I’m going to update Karaf related projects (CXF, Camel, ServiceMix, TIF, TSF) and focus on Apache Karaf Cellar 2.2.1 version 😉