camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paveltumilovich <>
Subject Can multiple camel routes cause a very large number of threads?
Date Thu, 01 Aug 2013 06:19:54 GMT
Hello everyone.

I have a task to integrate two systems: a frontend serving html and backend
which gives data to frontend. Backend have a very large REST api so I have
to use multiple routes. I planned to use single camel context and wrap all
routes into it.

<camelContext xmlns="">
    <from uri="direct:data"/>
    <to uri="ahc:http://localhost/data"/>
Then, I planned to invoke the route using @Produce annotation on service
method as adviced in Hiding middleware article

public interface Service {
    String data();

public class MyBean {
    @Produce(uri = "direct:data")
    protected Service producer;

    public void doSomething() {
        // lets send a message
        String response =;
As I understand information taken from here and here I'll end up with
additional 70 thread in my app (one for each route). I fear that it can
cause a serious performance hit and while the backend api will grow the
thread number will grow with it. Is it correct? How can I avoid this if it's
true? As I understand, I can't employ ExecutorService thread pool in this

Thanks in advance for any answer.

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message