Getting started with Camel 3

Let’s have a look at what’s new in Camel 3 with an example project which shows how to run a Camel 3 standalone via the built-in Main class. This example also demonstrates how you can configure the Camel application via Camel built-in dependency-injection that supports binding via the @BindToRegistry and @PropertyInject annotations. Apache Camel 3 … Read more

Proxy Web Services request with Camel

In this tutorial we will show how to proxy a request to a legacy JAX-WS Web service using Camel. A common scenario is that you have some legacy code (say some Web services) which cannot be reused becuase the interfaces or some conventions (e.g. namespaces) have changed. Proxing request to legacy code can also be … Read more

Building a Camel route to remote ActiveMQ

In this tutorial we will demonstrate how to create a simple Camel route which sends messages (based on a timer) to an ActiveMQ server. So first of all, let’s start ActiveMQ and verify that it’s listening on the TCP port: For example on a Windows machine: C:\>netstat -an | find “61616” TCP 0.0.0.0:61616 0.0.0.0:0 LISTENING … Read more

Basic Camel Architecture tutorial

This tutorial provides an overview of Camel architecture components. The Camel architecture consists of: CamelContext: This represents an instance of the Camel runtime environment running in a JVM. it represents a single Camel routing rulebase and works in a similar way to the Spring ApplicationContext. End points: They represent a message producer or consumer used … Read more

Transforming CSV to Java Objects using Camel

This tutorial shows how to perform a simple transformation from CSV to Java objects with Camel using as destination a processor or a JMS Queue. First of all, we will define a class mapping our CSV file. package com.sample.model; import java.io.Serializable; import org.apache.camel.dataformat.bindy.annotation.CsvRecord; import org.apache.camel.dataformat.bindy.annotation.DataField; @CsvRecord(separator = “,”) public class User implements Serializable { @DataField(pos … Read more

Using the Timer Component with Camel

The Timer component is used to generate message exchanges when a timer fires. The Timer is a simple, non persistence timer using the JDK’s in built timer mechanism. package com.sample; import org.apache.camel.CamelContext; import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.impl.DefaultCamelContext; import org.apache.camel.spi.DataFormat; public class Timer { public static void main(String args[]) throws Exception { CamelContext … Read more

Using Camel JDBC Component

In this tutorial we will learn how to perform some basic JDBC operations using Camel JDBC Component. The JDBC component enables you to access databases through JDBC, where SQL queries (SELECT) and operations (INSERT, UPDATE, etc) are sent in the message body. This component uses the standard JDBC API. In the following example, we will … Read more

Using Camel Netty Components to manage socket routes

The netty component is a socket based Caamel communication component, which relies on the Netty project. Netty is a client server framework designed around Java NIO API which enables fast and simple development of network applications either servers or clients. The advantage of using Netty is that it greatly simplifies network programming by means of … Read more

Using Camel Log component

Camel includes out of the box a Log Component that is useful for debugging, making easy to trace the content of the messages flowing through your routes. Typically this component is used just temporarily when developing your routes and it’s expected to be removed in production. Let’s see an example of how to use it … Read more

Invoking a jBPM 6 Process from Camel Spring

The Camel jbpm component provides integration with Business Process Management (BPM) Suit jBPM 6. Behind the hoods It uses kie-remote-client API to interact with jBPM instance over REST. Let’s see an example of it: Say you have the following process available from the business central of jBPM: The following sample blueprint shows how you can … Read more