Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Head First Go this week in the Go forum!

Ryan Sa

Greenhorn
+ Follow
since Mar 13, 2019
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ryan Sa

Is there a way to open circuit of a route until the aggregate batch transfer is complete?

I have checked Camel's route policy, but this works for a number of inflight exchanges. Also, I checked RouteBuilder's source code but looks like there is no such option.

I have the following route:



Now my use case is that I want to transfer 500 messages between these routes, and I use .throttle(500). But I also want to control that when the next batch of 500 messages should be routed. I want to route the next 500 messages only when the queue a2 becomes empty.

For example, messages are getting routed from queue a1 to a2. Say 500 messages have been routed successfully, now I want to suspend (or open circuit) of my route so that it won't transfer messages any further until the queue a2 becomes empty (there is a consumer which is pulling messages from queue a2)

Is there a way to achieve this in Apache Camel?
1 week ago