Search Tutorials

Apache Camel Hello World + JBoss Fuse | JavaInUse

JBoss Fuse Tutorial- Apache Camel Hello World


In previous project we created a Maven Project for deployment on JBoss Fuse. In this chapter we use the Camel File component to transfer file from one folder to the other and deploy it on JBoss Fuse.


This tutorial is explained in the below Youtube Video.

Lets Begin

The File component is present in the camel-core jar itself so no new dependency needs to be added. The camel configuration file is to be created in src->main->resources->META-INF->spring. This is the default path where
camel looks for the config files.
We will create Eclipse Maven project as follows-

The config file applicationContext.xml will be as follows.
We have created a camel context. Inside the context we have written a camel route. This route uses the file component to tranfer file from one folder to other Also here during the transfer from source folder we have written noop=true, this tells the server that the transferred file should remain in the source folder even after the transfer(copy paste). If this is not specified then after the transfer the file gets deleted from the source folder(cut paste).
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=""
	xmlns:xsi="" xmlns:camel=""
	xmlns:osgi="" xmlns:cxf=""

	<camelContext id="camelId" xmlns="">
			<camel:from uri="file:C:/inbox?noop=true" />
			<camel:to uri="file:C:/outbox" />


That is the only code required.Now run the following Maven command-clean:install Next go to fuse.bat and start it by double clicking on it. To run the jar file that is generated in .m2 repo type the following command -install mvn:com.javainuse/camel-file-transfer/0.0.1-SNAPSHOT.. This gives us a bundle-id. Next run the start bundle-id command.
Our camel-file-transfer application is now up and running.
If not already present a folder named inbox will get generated in C drive. Any file copied to this folder will get
automatically copied to a folder named outbox in C drive.

Download Source Code

Download it - Apache Camel Hello World

See Also

File Transfer using Java DSL Apache Camel Integrate Apache Camel and ActiveMQ EIP patterns using Apache Camel Camel application deployment on JBoss Fuse Apache Camel +Spring + ActiveMQ + JBoss Fuse Apache Camel + Apache CXF SOAP Webservices Apache Camel- Main Menu