Wednesday, October 21, 2009

A jira notification system for irc using camel

Last week, I thought that it would be a nice idea to have JIRA notifications for our Apache projects on IRC (for projects that sometimes use an IRC channel). So I came up with a very simple solution using Camel deployed on top of Karaf.

The application itself consists in a single xml file to be copied in the deploy folder of your Karaf installation. This was one of my requirements for ease of maintenance. This is possible because of the nice hot deployment mechanism for spring xml applications in Karaf.

Now, if you log onto the #camel, #cxf, #servicemix or #activemq IRC channels, you'll see some messages that look like:


jirabot: Claus Ibsen - Created: (CAMEL-2090) camel-jms -
Option autoStartup does not work
(see https://issues.apache.org/activemq/browse/CAMEL-2090 )


Those are all generated by the following applications:


<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
">

<manifest>
DynamicImport-Package=*
</manifest>

<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="imaps://imap.gmail.com:993?username=xxx&amp;password=xxx&amp;consumer.delay=1000&amp;delete=false" />
<convertBodyTo type="java.lang.String"/>
<!-- Remove any cr/lf that would cause regexp to not work -->
<setHeader headerName="tmpsubject">
<mvel>
request.headers.subject.replaceAll("\r\n", " ").replaceAll("\r|\n", "")
</mvel>
</setHeader>
<!-- Extract the user name from the from header -->
<setHeader headerName="tmpfrom">
<mvel>
request.headers.from.replaceAll(".*\"(.*)\".*", "$1").replace("(JIRA)", "")
</mvel>
</setHeader>
<choice>
<!-- Camel -->
<when>
<mvel>
request.headers.tmpsubject.matches(".*jira.*(CAMEL-[0-9]+).*")
</mvel>
<setHeader headerName="irc.target">
<constant>#camel</constant>
</setHeader>
<setHeader headerName="issuelink">
<mvel>
" (see https://issues.apache.org/activemq/browse/" +
request.headers.tmpsubject.replaceAll(".*jira.*(CAMEL-[0-9]+).*", "$1") +
" )"
</mvel>
</setHeader>
</when>
<!-- other projects filtering using the exact same mechanism -->
<!-- Other non jira emails -->
<otherwise>
<setBody><mvel>
request.headers.from + ": " + request.headers.tmpsubject
</mvel></setBody>
<setHeader headerName="irc.target">
<constant>#jirabot.test</constant>
</setHeader>
</otherwise>
</choice>
<setBody>
<mvel>
request.headers.tmpfrom + "- " +
request.headers.tmpsubject.replace("[jira]", "") +
request.headers.issuelink
</mvel>
</setBody>
<to uri="irc:irc.codehaus.org/?nickname=jirabot&username=jirabot" />
</route>
</camelContext>

</beans>


This has been a small and enjoyable exercise. Camel rocks!

Wednesday, June 24, 2009

Apache SSHD 0.1.0

Last week, we (the Apache Mina team) released the first version of the SSH library I've began and already blogged about.

The SSHD project provides a server side implementation of the well known SSH protocol. It also provides a client side API which is currently limited and needs improvements (any help welcome!).

Look at the release page for more informations.

OSGi Blueprint Services

I gave a presentation on Monday at the OSGi DevCon in Zurich about Blueprint services.
Blueprint Services is the OSGi standardized version of Spring-DM which I've been working on (both the spec and the implementation over the last weeks).
Below is the presentation. The spec is not published yet, but the implementation code is currently available at:
http://svn.apache.org/repos/asf/geronimo/sandbox/blueprint
This implementation is now integrated into Apache Felix Karaf, a ready to use distribution of OSGi for enterprise / server side applications.

Thursday, April 02, 2009

Apache Karaf

ApacheCon was really interesting this year! Recently, a lot of people have expressed a real interest in ServiceMix Kernel, our generic OSGi distribution for server side applications. We've been discussing moving this subproject into Apache Felix for several reasons:
  • raise the visibility and awareness on ServiceMix Kernel
  • attract a broader community

Several Apache projects are planning to use ServiceMix Kernel as their container: this includes Apache James, Apache Directory and Apache ActiveMQ. The Apache Sling community is also willing to contribute to this effort along with some other groups like the OPS4J project.

During this discussion, a name as been proposed by Jamie Goodyear: Apache Karaf.
A carafe is a small container used for serving wine and other drinks (http://en.wikipedia.org/wiki/Carafe). In similarity to the name the Kernel allows applications to be more easily handled, and improves their characteristics (much like a bottle of wine left to breath in a decanter) :)

I have to thanks Jamie for this name, I really like it. Plus the K might eventually fill a hole in the list of Apache projects and also reminds the Kernel.

Moving into Felix does not mean that Karaf will be tied to the Felix OSGi runtime. We haven't really worked on that yet, but the goal is to be able to use either Felix or Equinox runtimes inside Karaf. Maybe we'll provide two different distributions in the future...

Today, both ServiceMix and Felix community have voted and accepted this move. I think this is a great news for ServiceMix Kernel users, for the Apache communities and for all OSGi users and I'm really excited about that...

New clustering engine in ServiceMix 4

I have expressed several times on the mailing list that the JMS flow included in ServiceMix 3 has some deficiencies. Learning from that, ServiceMix 4 has a brand new clustering engine that Adrian and I have discussed a bit at ApacheCon. He blogged about that recently, so have a look at his blog post.

Apache ServiceMix 4.0.0 and Apache ServiceMix NMR 1.0.0

During ApacheCon last week, we're released Apache ServiceMix 4.0.0, the first release of our OSGi-based integration platform.
We've also released Apache ServiceMix NMR 1.0.0 which contains the NMR layer, the JBI layer. The main distribution is a minimal JBI container with no components.
Have a look at those, we welcome your feedback!

Whitepaper: Large scale deployments with ServiceMix 4

At ApacheCon Europe last week, Andreas Gies, a coworker, has given a nice presentation about large scale deployments with ServiceMix 4. It has been now published as a whitepaper and is available on the FUSE site.

Wednesday, March 18, 2009

Apache ServiceMix Kernel 1.1.0 released

The new version of Apache ServiceMix Kernel has just been released.

This new release brings a lot of new features, enhancements and bug fixes:
* remote connection using SSH protocol
* provisioning enhancements: versioning / hot deployment of features
* new commands, including OSGi related commands for the Configuration
Admin and Package Admin services
* improved spring integration: upgrade to spring 2.5.6 and spring-dm
1.2.0-m2, the osgi/list command now displays spring applications status
* container level locking for master / slave deployments
* support for JAXP 1.4 on all platforms
* improved JMX support for managing the OSGi framework and features

You'll find download links and details release notes at the following location.