Morning! Here’s a quick tip on camel-http and proper retry logic within error handling. Under the hood, camel-http uses Apache’s HttpClient, which provides its own retry logic by default. Adding Camel’s onException redeliveries on top of that ends up multiplying the attempts.
While working with a new client on some Camel-based microservices, I’ve been trying my best to keep a list of caveats and potential issues that occasionally pop up. Camel’s integration patterns and components are extremely powerful and include many bells and whistles. But unfortunately, that flexibility can also get in the way…
Without further ado, here’s the running list. I’ll come back and update these, periodically!
If you have experience with Apache Camel, this one might sound a little obvious. But, it has recently come up a few times, so it’s worth mentioning. As an example, say you have a route that iterates over paged data and does something with it, and you therefore need to keep track of the pagination. You might use something like the following:
By default, each Apache Camel route has its own error handler, meaning each independently catches and handles Exceptions thrown within it. But, what if a “parent route” needs to catch and handle Exceptions thrown by a sub-route? Here’s one approach: Continue reading Apache Camel: Throw Exception from Sub-Route to Previous Route