Search Tutorials

Spring Boot Tutorial - Integrate Spring Boot + Apache Camel | JavaInUse

Spring Boot Tutorial- Integrate Spring Boot+ Apache Camel

In this example we see how to use Apache Camel with a Spring Boot Application.
Apache Camel is a rule-based routing and mediation engine that provides a Java object-based implementation of the Enterprise Integration Patterns using an API (or declarative Java Domain Specific Language) to configure routing and mediation rules. More tutorials for Apache Camel can be found in Apache Camel Section


This tutorial is explained in the below Youtube Video.

Lets Begin-

Maven Project will be as follows-

Spring Boot Apache Camel Example

In the Maven we need the camel dependency.Maven will be as follows-
<project xmlns="" xmlns:xsi="" xsi:schemaLocation="">


Create the as below-
package com.javainuse;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

public class SpringBootHelloWorldApplication {

	public static void main(String[] args) {, args);
Next we add class with the Camel routes.This routes will be started automatically.
package com.javainuse;

import org.apache.camel.builder.RouteBuilder;
import org.springframework.stereotype.Component;

public class MyRoute extends RouteBuilder {

	public void configure() throws Exception {

To keep the main thread blocked so that Camel stays up,add camel.springboot.main-run-controller=true to the

This is the only code needed to get started.
Compile and the run the as a Java application.

Spring Boot Apache Camel Tutorial
As can be seen above one route has been started. It copies files from inputFolder to the outputFolder.

Download Source Code

Download it -
Spring Boot + Apache Camel

See Also

Spring Boot Hello World Application- Create simple controller and jsp view using Maven Spring Boot Tutorial-Spring Data JPA Spring Boot + Simple Security Configuration Pagination using Spring Boot Simple Example Spring Boot + ActiveMQ Hello world Example Spring Boot + Swagger Example Hello World Example Spring Boot + Swagger- Understanding the various Swagger Annotations Spring Boot Main Menu Spring Boot Interview Questions