camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paveltumilovich <paveltumilov...@gmail.com>
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="http://activemq.apache.org/camel/schema/spring">
    <from uri="direct:data"/>
    <to uri="ahc:http://localhost/data"/>
    
</camelContext>
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 = producer.data();
    }
}
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
case.

Thanks in advance for any answer.



--
View this message in context: http://camel.465427.n5.nabble.com/Can-multiple-camel-routes-cause-a-very-large-number-of-threads-tp5736620.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message