RE: Throttling from direct to bean

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

RE: Throttling from direct to bean

Valdis
Please disregard, the issue was with the bindings in the Rabbit exchanges.
Feeling silly now, apologies for the spam.


Thanks,
Valdis

From: Valdis Andersons
Sent: 02 July 2019 18:06
To: [hidden email]
Subject: Throttling from direct to bean

Hi All,

Would anyone know if this is possible to do with the Camel Throttler? Here is the routing:

--- from AbstractRouteBuilder---

from("rabbitmq:bufferedExchange?connectionFactory=rabbitConnectionFactory&autoDelete=false&queue=bufferQueue")
                                .startupOrder(startOrder)
                                  .process(exchange ->
                                                                {
                                                                                exchange.getIn().setHeader("rabbitmq.DELIVERY_MODE", 2);

                                                                }
                                                })
                                .to("direct:mesageReceiver?block=true&timeout=30000");

--- from a concrete Route Builder implementation that extends the AbstractRouteBuilder---

from("direct:mesageReceiver")
                   .log("Receiving on throttled route ${body}")
                                .throttle(1)
                                .timePeriodMillis(15000)
                                .to("bean:messageProcessingBean");

The throttle is needed here in order to prevent the messageProcessingBean to overwhelm a web service endpoint that it's calling. The requests tend to be rather big and the WS is quite slow.

What I'm seeing at the moment with the above is that my rabbitmq consumers have been stopped after the first message has gone through but after the 15sec time period nothing has started up again, so no more messages are coming through. Is the above config not suited to what I want to do with the routes or am I missing something here? If not I can just have a route builder that doesn't use the AbstractRouteBuilder it'd just mean I have to set the delivery mode header in the concrete route builder.


Thanks,
Valdis