camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apara <>
Subject Unable to setup route with limit of 30 queue size and 5 processing threads
Date Wed, 29 Apr 2015 23:44:41 GMT
I am trying to build a route at runtime which limits the caller to maximum of
30 objects in a queue, with 5 concurrent processing threads.  I also want
the caller to get an exception when more than 30 objects attempt to be
inserted into the route.

Following this example:

I created a RouteBuilder and implemented the configure method as:


        routeDefinition =

My makeProfile function is implemented as:

            final ThreadPoolProfile profile = new
            this.threadPoolProfile = profile;

My program runs, and I see multiple threads executing methods, but never at
the same time.  It seems that when one execution ends, the next one starts
on a different thread, but never both in parallel.  Also, my client
inserting records in to the queue never get's an exception when 30 records
are reached.  

Adding some more debug, I see that the client submits request to the end
point and the route executes then the client is allowed to add another
record.  I was hoping that the client would add 30 records at a time and
then either wait or get an exception.

I tried to prefix the names of the endpoints with direct://, vm://, direct:,
vm: but it did not make any differences.  

I am creating a Proxy which I am eventually using to submit requests:

            //Create proxy
            final SingleRecordProcessor
                proxy =
                    new ProxyBuilder(

Not sure if this is an issue or not.

Not sure what to try next.



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

View raw message