Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
Unknown
Description
Camel ServiceHelper suspends and resumes services in a wrong way:
- Resume: https://github.com/apache/camel/blob/camel-2.18.1/camel-core/src/main/java/org/apache/camel/util/ServiceHelper.java#L313
- Suspend: https://github.com/apache/camel/blob/camel-2.18.1/camel-core/src/main/java/org/apache/camel/util/ServiceHelper.java#L384
When suspending a service, Camel checks if the service is implementing the Suspendable (marker) interface, while that interface is ignored when resuming it.
If you take a non Suspendable service like the TimerConsumer (it is not Suspendable but it is a SuspendableService, like many others...), the ServiceHelper will call the "stop()" method when suspending it, and the "resume()" method when resuming it. Practically it'll remain stopped ("resume()" is not implemented in > 90% of the components), since "start()" should be called after a stop operation.
So the ThrottlingInflightRoutePolicy, that suspends a route when there are too many exchanges and resumes it when they get lower than a threshold, is broken for many components (the route is stopped, but it's never restarted correctly).