davsclaus commented on code in PR #31007:
URL: https://github.com/apache/camel/pull/31007#discussion_r4721018925
##########
components/camel-pulsar/src/test/java/org/apache/camel/component/pulsar/integration/PulsarSuspendRouteIT.java:
##########
@@ -151,8 +158,21 @@ public void configure() {
producer.send("test");
- context.getRouteController().suspendRoute(ROUTE_ID);
+ // suspend only once the exchange is in-flight. suspendRoute blocks
until the in-flight exchange completes,
+ // so it runs in another thread. The processor is released only after
the consumer is suspended, which is
+ // what the shutdown strategy does before it waits for the in-flight
exchange
+ assertTrue(exchangeInFlight.await(30, TimeUnit.SECONDS));
+ Consumer consumer = context.getRoute(ROUTE_ID).getConsumer();
+ CompletableFuture<Void> suspension = CompletableFuture.runAsync(() -> {
+ try {
+ context.getRouteController().suspendRoute(ROUTE_ID);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
Review Comment:
Confirmed in 0b896cfc73: the processor is released only once the consumer
reports `isSuspended()`, matching the order of `DefaultShutdownStrategy`, and
the root cause is corrected. Thanks!
_Claude Code on behalf of davsclaus_
--
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]