13

Recently i have started using camel and i see that it potentially addresses a lot of my integration layer needs.

I have created a java client application (not running in any container) where i defined two routes:

route1: move a file from an incoming folder1 to folder2

route2: move file content from folderx to mq queue.

I start my application and these routes are doing their job polling those folders and routing messages accordingly.

Can anyone explain me how the routes work. Does camel(context) create a thread for each route. What exactly happens?

Note: I could not find a straightforward notes on this on the camel site.

techuser soma
  • 4,766
  • 5
  • 23
  • 43

1 Answers1

15

It depends on the components you use in the routes, how many threads are being created and used.

As well as some EIPs in Camel supports multiple threads (thread pools) and thus can be configured to use N number of threads.

In your example its the file component, and it uses a single thread. As you have 2 routes, you will then use 2 threads. Some components also allows to configure their threading (eg thread pools). For example recently we added support for that for the file component in Camel 2.10 (see the scheduledExecutorService option at https://camel.apache.org/components/latest/file-component.html)

There is some notes here about Camel threading model http://camel.apache.org/threading-model.html

schrom
  • 1,372
  • 1
  • 22
  • 36
Claus Ibsen
  • 56,060
  • 7
  • 50
  • 65