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

   Thanks for the review. All five points are in a382b6e (a follow-up commit, 
no force push).
   
   1. Timer thread per consumer: fixed. `HostApplicationBuilder.build()` now 
calls `SequenceReorderManager.getInstance().stop()` before it builds the host 
application, as you suggested. The stop and the build run under one lock shared 
by all builds, so two consumers built at the same time cannot both start a 
timer. I checked tahu-host 1.0.21 with `javap`: `stop()` cancels the timer and 
sets it to null, and `TahuHostCallback`'s constructor calls `start()`, which 
creates a new `Timer("SequenceMonitorTimer")`. The new test 
`oneSequenceMonitorTimerThread` creates five consumers and waits until one live 
`SequenceMonitorTimer` thread is left. It fails on the previous head of this 
PR. The one timer that is left still runs after the last consumer stops, as on 
main. I left that alone.
   
   2. Two consumers in one JVM: you are right. I dropped 
`consumersOfTwoContextsGetTheirOwnMessages` and fixed the comment in 
`TahuHostConsumer`. The tahu-host page (and its catalog copy) now has a short 
"One Host Application consumer per JVM" section. One detail I added there: a 
consumer is created when its route is set up, so a second `tahu-host` route 
with `autoStartup=false` also takes the messages. I also fixed the PR 
description. I did not file a JIRA or an Eclipse Tahu issue; I can file one if 
you want.
   
   3. Real dispatch test: done. `routeAddedAgainGetsTheMessages` uses 
`FakeMqttBroker`: route `host` to `mock:a`, `stopRoute` + `removeRoute`, the 
same `from` to `mock:b`, wait for the second `spBv1.0/#` subscription, publish 
an NBIRTH. `mock:b` gets it and `mock:a` gets nothing. With the main versions 
of `TahuHostConsumer` and `TahuHostApplication` it fails (`mock:b` receives 
nothing), and it passes with the fix. `getEventHandler()` and 
`getTahuHostApplication()` are removed.
   
   4. The stale comment in `TahuHostConsumerMessageTest` is removed.
   
   5. The new test uses JUnit `Assertions` only.
   
   Runs: camel-tahu unit tests 20 run, 0 failures; the new test class 20 times 
in one JVM, 40 of 40.
   
   _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