Thursday, November 21, 2013

Camel Extra release life cycle finally in place

This is an epic moment for all the Camel Extra users. For the very first time in the history of the project we are finally in sync with the release cycle of Apache Camel.

The above basically means that from now on you can always use the version of Camel Extra component which is tested against your version of Apache Camel. For example if you want to use Hibernate component in your project using Camel 2.12.1, you can use the same version of the latter component as your ASF Camel dependencies.
<properties>
  <camel-version>2.12.1</camel-version>
</properties>
...
<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-core</artifactId>
  <version>${camel-version}</version>
</dependency>
<dependency>
  <groupId>org.apache-extras.camel-extra</groupId>
  <artifactId>camel-hibernate</artifactId>
  <version>${camel-version}</version>
</dependency>
From this point forward Camel Extra is distributed in the same versions as Apache Camel, starting from 2.10.0. For this moment that would be:
  • camel-extra-2.10.0
  • camel-extra-2.10.1
  • camel-extra-2.10.2
  • camel-extra-2.10.3
  • camel-extra-2.10.4
  • camel-extra-2.10.5
  • camel-extra-2.10.6
  • camel-extra-2.10.7
  • camel-extra-2.11.0
  • camel-extra-2.11.1
  • camel-extra-2.11.2
  • camel-extra-2.12.0
  • camel-extra-2.12.1
Catching up the Apache Camel life cycle takes the burden of answering the users' question "Why there is no Hibernate component in version ${put your Apache Camel version here} available in Maven Central?" from me :) . Many thanks for all the Camel Extra riders contributing to the release process. Special thanks go to our new committer Christoph Emmersberger. Kudos for all your great work during the laborious release process!

Friday, September 27, 2013

Open source friendly CI hosting with CloudBees

I haven't got much experience with CloudBees cloud services so far. However last week I asked CloudBees guys if Camel Extra could benefit from their Open Source program. The answer was positive and hereby we got 2500 minutes of free Jenkins builds per month for Camel Extra.

The overall experience with the Jenkins instance hosted at CloudBees infrastructure is really good. If you just want to run jobs on the Jenkins instance pre-configured according to the expert's guides (yes Kohsuke, I'm looking at you!)  - the CloudBees is a way to go.

On the behalf of Camel Extra team, many many many thanks to the CloudBees guys for hosting the free Jenkins instance for us. You are true friend and supporter for the Open Source projects like ours :) .

Tuesday, September 17, 2013

Camel Extra 2.10.5 and 2.10.6 have been released

This month two overdue version of Camel Extra (2.10.5 and 2.10.6) have been released and are now available in the Maven central. This way we are in sync with all the Apache Camel 2.10 releases.

The next item in the Camel Extra team backlog is to release Camel Extra 2.11 and 2.12 artifacts. Ideally I would like to be always in sync with Apache Camel release cycle, but to achieve this state we need to improve out release process a little bit. :) .

Keep in mind that we always appreciate contributions to the release effort, so if you would like to help us to speed up Camel Extra releases, just drop me a line.

Tuesday, September 3, 2013

My ServiceMix book hit the market

OK, this is not a real news, as it happened some time ago. :) For those who still doesn't know - my very first book "Instant Apache ServiceMix How-to" has been published by Packt.

If you are looking for the good source of knowledge that would help you to start your adventure with the coolest lightweight ESB in the universe (aka ServiceMix), this is the right book to read. Packt's Instant books are pretty brief, mine is less than 70 pages. Ideal for ServiceMix bootstrap.

Here, here and here you can find some reviews of my publication.

Monday, September 2, 2013

Spring Scala 1.0.0.RC1 is out

I happy to say that just a few days ago Spring Source deployed the very first release candidate of Spring Scala, one of the open source projects I'm involved into. If you are not a kind of "no framework" zealot and use Scala, you definitely must check out this project.

Spring Scala 1.0.0.RC1 comes with many minor fixes and enhancements. Some of them are:
  • fixed some infamous stack overflow exceptions
  • upgraded project to use the latest version of Scala (2.10.2)
  • added bean access syntactic sugar to application context
  • enhanced transactions support
  • added basic Spring Test support
  • added component scan DSL support
  • and many more
Starting from this version Spring Scala will be distributed with Scala version suffix (to follow SBT versioning  convention). In order to enjoy the latest RC in your Maven project, use the following build configuration.
<repositories>
    <repository>
        <id>milestone.repo.springsource.org</id>
        <name>repo.springsource.org-milestone</name>
        <url>https://repo.springsource.org/libs-milestone</url>
    </repository>
</repositories>
<dependency>
    <groupId>org.springframework.scala</groupId>
    <artifactId>spring-scala_2.10</artifactId>
    <version>1.0.0.RC1</version>
</dependency>
Keep in mind that Spring Scala is still looking for feature requests to be implemented and, at last but not least, contributors.

Wednesday, June 5, 2013

JobExecution access in Camel Spring Batch

Starting from Apache Camel 2.10, our users can benefit from the Spring Batch component. Recently one of such users approached me with the question - how can I access execution context of job started by Camel.

So far the easiest way to access JobExecution instance from the Camel was to register CamelJobExecutionListener to the Spring Batch.
<batch:job>
  <batch:step>
  ...
  </batch:step>
  <batch:listeners>
    <batch:listener ref="camelJobExecutionListener"/>
  </batch:listeners>
</batch:job>

<bean id="camelJobExecutionListener"
  class="org.apache.camel.component.spring.batch.support.CamelJobExecutionListener">
  <constructor-arg ref="camelTemplate"/>
  <constructor-arg value="seda:jobExecutionEventsQueue"/>
</bean>
Example above demonstrates how to collect JobExecution instances sent to Camel before the batch job is started and after it is completed. In this particular case JobExecutions will be collected in the SEDA queue named jobExecutionEventsQueue.

Starting from the Camel 2.11.1 SpringBatchProducer will also automatically forward JobExecution instance (one returned by the JobLauncher) as the output message. You can use the obtained JobExecution reference to perform some operations using the Spring Batch API directly.
from("direct:startBatch").
  to("spring-batch:myJob").
  to("mock:JobExecutions");
...
MockEndpoint mockEndpoint = ...;
JobExecution jobExecution = 
  mockEndpoint.getExchanges().get(0).getIn().getBody(JobExecution.class);
BatchStatus currentJobStatus = jobExecution.getStatus();
I hope this tiny enhancement will improve the experience of using Spring Batch with Apache Camel. If we can do anything to make the Camel Spring Batch API more developer-friendly, just drop us a line. Camel riders are always eager to improve components API.

Tuesday, May 7, 2013

Component scan support for Spring Scala

Just a few days ago an interesting feature has been committed into the Spring Scala master branch. From this point forward Scala configuration in Spring supports component scanning as the first-class citizen.

Component scanning is an extremely useful feature of Spring Framework which provides the support to dynamically compose the application context, depending on the content of the application classpath. Component scanner basically looks up the classpath in order to find the classes marked with dedicated annotations (such as @Component or @Service). The latter classes are then registered in the application context as the bean definitions. Class eligible for classpath scanning could look as follows.
package org.example;

import org.springframework.stereotype.Component;

@Component
public class MyComponent {}
To enable component scanning in Spring XML configuration, we usually include the <context:component-scan/> element in the wiring file.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:context="http://www.springframework.org/schema/context"
     xsi:schemaLocation="http://www.springframework.org/schema/beans
         http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
         http://www.springframework.org/schema/context
         http://www.springframework.org/schema/context/spring-context-3.0.xsd">

   <context:component-scan base-package="org.example"/>

</beans>
People who favor Java Spring configuration style over XML files, usually fall back to the @ComponentScan annotation.
@Configuration
@ComponentScan({"org.example"})
public class MyApplicationConfig {}
Starting from the next milestone of Spring Scala (i.e. 1.0.0.M3) you will be able to use similar component scan syntax in the FunctionalConfiguration classes. In order to take the advantage of new component scanning API in Spring Scala, you need to enhance your configuration with ContextSupport trait.
 
class MyScalaApplicationConfig 
  extends FunctionalConfiguration with ContextSupport {

  componentScan("org.example", "com.example")

}
If you need more strict control over the scanning configuration, you can pass additional options into the componentScan method call.
 
class MyScalaApplicationConfig 
  extends FunctionalConfiguration with ContextSupport {

  componentScan(basePackages = Seq("org.example"),
    scopedProxy = Some(ScopedProxyMode.TARGET_CLASS),
    excludeFilters = Seq(new RegexPatternTypeFilter(Pattern.compile(".*Test")))
  )

}
Until the reference documentation for Spring Scala is released, please refer to the Scaladoc of ContextSupport trait for more details of component scan API.