davsclaus opened a new pull request, #30941: URL: https://github.com/apache/camel/pull/30941
_Claude Code on behalf of Claus Ibsen (davsclaus)_ JIRA: [CAMEL-27044](https://issues.apache.org/jira/browse/CAMEL-27044) `startRoute` on a route that was already started started its consumer again (`doStartOrResumeRouteConsumers`), without `RoutePolicy.onStart`, as the route service was already started. A route policy that keeps the consumer stopped while the route stays started was bypassed: `MasterRoutePolicy` on a node that is not the master (found by the zookeeper-master DST world), `HazelcastRoutePolicy`, `DnsActivationPolicy`, the throttling policies and a `ScheduledRoutePolicy` that suspends. The same happened through `resumeRoute`, and through `startAllRoutes` / `startRouteGroup`, whose `isStartable` looked at the state of the consumer. ### Change Starting a route that is already started is a no-op: its consumer and its route policy are left as they are. - `AbstractCamelContext.startRoute` and `resumeRoute` return at once for a started route (as `suspendRoute` does for a route that is not started). A suspended route is still resumed, a stopped one started. - `InternalRouteStartupManager.isStartable` uses only the status of the route service. The check of the consumer dates from the context suspend of Camel 2.x, when a consumer that cannot be suspended was stopped without the route status showing it; `doSuspend` now marks such a route stopped. - `startRouteService` is unchanged, so `stopRoute(..., abortAfterTimeout=true)` still starts the consumer again of the route it leaves started. Upgrade guide: to start the consumer of a started route again, stop and start the route. ### Tests - New `RoutePolicyStartStartedRouteTest`: a policy keeps the consumer stopped; `startRoute`, `resumeRoute`, `startRouteGroup` and `startAllRoutes` leave it stopped and call no `onStart`; stop and start calls `onStart` again. 4 of the 5 fail on main. - New `DefaultCamelContextSuspendResumeNotSuspendableTest`: a context suspend / resume with a consumer that cannot be suspended still resumes it. - The zookeeper-master DST world starts a started route from outside in its default set now (the `dst.zookeeper.startStartedRoute` property is gone, `test-dst.adoc` updated): 1000 of 1000 seeds pass; against the unfixed engine seed 401 fails. - Full camel-core: 9955 tests, 0 failures (one unrelated flake, `AggregateParallelThreadPoolAbortTest`, passed on rerun). camel-zookeeper-master (1043), camel-management `ManagedRoute*` / `ManagedCamelContext*` (126), camel-quartz `*RoutePolicy*` (31) pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0128ThHB3iQdrvSRLVBGRrdP -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
