Skip to content

An example for consuming files from a shared directory using Camel in a clustered environment.

Notifications You must be signed in to change notification settings

joshdreagan/clustered-file-consumer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Clustered Camel File Consumer

This example shows how to consume files from a shared directory across multiple JVM instances. It does so by using a shared inProgressRepository. In this example, I used Inifinispan, but it could just as easily be a database or any other org.apache.camel.spi.IdempotentRepository.

Requirements

Building Example

Run the Maven build

~$ cd $PROJECT_ROOT
~$ mvn clean install

Running Camel

Open up two terminal windows.

Terminal 1:

~$ cd $PROJECT_ROOT
~$ mvn -Djava.net.preferIPv4Stack=true -Dorg.apache.camel.examples.clusterInstanceId=instance01 camel:run

Terminal 2:

~$ cd $PROJECT_ROOT
~$ mvn -Djava.net.preferIPv4Stack=true -Dorg.apache.camel.examples.clusterInstanceId=instance02 camel:run

Testing

Copy some files into $PROJECT_ROOT/target/input. You should see each of the files picked up by 1 and only 1 of the consumers.

About

An example for consuming files from a shared directory using Camel in a clustered environment.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published