You can maybe implement a custom route policy that suspend/resume the
route depending on that destination queue has space or not.
http://camel.apache.org/routepolicy

If the message queue is a JMS broker queue then you cannot peak ahead
of it using a standard api -well there is the browse JMS api but that
is generally slow. But AcitveMQ offers a advistory message you can use
to get queue stats back, or use its JMX api. For remote call thens
then jolokia is recommended as it can do JMX calls as REST/HTTP.

On Fri, Nov 20, 2015 at 6:21 PM, apara <[email protected]> wrote:
> So, the question really is:
>
> Is there a way to control how messages are de-queued?
>
> In other words:
>
> Instead of this:
>
> 1) Message is dequeued
> 2) Load balancer cannot be sent onto the proper destination  because it's
> queue is full
> 3) Load balancer blocks
>
> How can I implement:
> 1) Peek at the message in the queue
> 2) If load balancer can not send it to the proper destination because
> destination's queue is full peek ahead in the queue for the message which is
> not destined to this destination
> 3) Repeat 2 until a message if found which can be sent to some queue
> 4) Send the message to the proper queue
>
> Is there an easier way to implement this?
>
> Thanks.
> -AP_
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/How-to-implement-a-peek-ahead-skip-processing-in-queue-tp5774068p5774156.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Reply via email to