allthingssecurity commented on PR #28707:
URL: https://github.com/apache/camel/pull/28707#issuecomment-6518236959

   @davsclaus thanks, all in a9acfbfb4000:
   
   - Context stop: `doStop` now closes the channel when `connectCount == 0 || 
getCamelContext().isStopping()`. I checked the order in 
`AbstractCamelContext.doStop`:
     1. `shutdownForced` stops the route inputs and drains the in-flight 
exchanges.
     2. The route services shut down.
     3. The endpoints stop.
     4. The context's own services stop.
   
     So when this branch runs during a context stop, the only users still 
counted are ones Camel does not stop.
   
     One correction to the example: the singleton producer of a 
`createProducerTemplate()` template is registered by the producer cache with 
`addService(producer, true, true)` (`ServicePool.SinglePool.acquire`). Camel 
stops it in step 4, and its last disconnect already closes the channel; a test 
confirmed this passes without the change.
   
     The case the change does cover is a producer or consumer created with 
`createProducer()`/`createConsumer()` and started by the application. New test 
`stopCamelClosesTheChannelThatAProducerNotStoppedByCamelStillUses` uses such a 
producer: `context.stop()` closes the channel, and the producer's late stop 
does not throw. It fails without `isStopping()`.
   - `disconnect()`: hardened like #28708. The channel disconnect is in a 
try/catch with a WARN, and the close for a stopping or stopped endpoint still 
happens. New test 
`theLastDisconnectClosesTheChannelAlsoWhenDisconnectingItFails`, which fails 
without the try/catch.
   - `removeConsumerRouteThenAddItAgain` now also expects `mock:consumer2` to 
receive `"c"`.
   - Added the one-line comment on `enableViewMessages=false` in `OTHER`.
   
   camel-jgroups: 38 tests, 0 failures. Both changed test classes passed 20 
runs in one JVM. PR body updated to match.
   
   _Claude Code on behalf of allthingssecurity_
   


-- 
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]

Reply via email to