You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ee7arh <an...@2e-systems.com> on 2008/10/10 16:44:03 UTC

Configure behaviour when "maxConcurrentConsumers" reached (Exception thrown instead of blocking)

Hi,

Is it possible to configure the behaviour of an endPoint that when the
maxConcurrentConsumers limit is reached, an exception will be thrown rather
than blocking until the currentConsumers drops?

I searched around and can't see anything like this.

The background is that we have a server application which we only want to
allow 40 concurrent requests through, if more is reached we would rather
return an error rather than keeping the client waiting for an unknown length
of time.

Having said that, if this is not possible, can I instead specify a timeout
value so that if a client is blocking whilst waiting for a consumer to
become available (because at that time, the maxConcurrentConsumers limit is
reached), it will eventually timeout? (or a timeoutException will be
thrown)? Therefore we could guarantee to return a response within a certain
length of time.

For reference, here is our Spring config:

<bean
               
class="org.springframework.jms.listener.DefaultMessageListenerContainer">
                <property name="connectionFactory"
ref="connectionFactoryActiveMQ"/>
                <property name="destination" ref="inOutQueue"/>
                <property name="maxConcurrentConsumers" value="5"/>
                <property name="concurrentConsumers" value="2"/>
                <property name="messageListener" ref="myServices"/>
        </bean>


Thanks
Andrew
-- 
View this message in context: http://www.nabble.com/Configure-behaviour-when-%22maxConcurrentConsumers%22-reached-%28Exception-thrown-instead-of-blocking%29-tp19919714s22882p19919714.html
Sent from the Camel - Users mailing list archive at Nabble.com.