Same result - works with the sleep; fails without it...which seems odd
- I wonder if it's a result of using the onCompletion() stuff to shut
things down.

I added some logging to see what's happening.

Without the sleep call it looks like this:

[thread #0]  INFO 2012-02-04 10:43:16,646: shutting down route
DirectCopyRoute and main (my message)
[main]  INFO 2012-02-04 10:43:16,646: Asserting: Endpoint[mock://test]
is satisfied
[main]  INFO 2012-02-04 10:43:16,647: checking to see if stop was
called (my message)
[thread #0]  INFO 2012-02-04 10:43:16,647: Starting to graceful
shutdown 1 routes (timeout 10 seconds)
[thread #1]  INFO 2012-02-04 10:43:16,650: Route: DirectCopyRoute
shutdown complete, was consuming from: Endpoint[direct://test]
[thread #0]  INFO 2012-02-04 10:43:16,650: Graceful shutdown of 1
routes completed in 0 seconds
[thread #0]  INFO 2012-02-04 10:43:16,651: Route: DirectCopyRoute
stopped, was consuming from: Endpoint[direct://test]
[thread #0]  INFO 2012-02-04 10:43:16,657: everything is shut down now
(my message)

With the sleep, it looks like this:

[thread #0]  INFO 2012-02-04 10:45:49,111: shutting down route
DirectCopyRoute and main (my message)
[main]  INFO 2012-02-04 10:45:49,111: Asserting: Endpoint[mock://test]
is satisfied
[thread #0]  INFO 2012-02-04 10:45:49,112: Starting to graceful
shutdown 1 routes (timeout 10 seconds)
[thread #1]  INFO 2012-02-04 10:45:49,114: Route: DirectCopyRoute
shutdown complete, was consuming from: Endpoint[direct://test]
[thread #0]  INFO 2012-02-04 10:45:49,115: Graceful shutdown of 1
routes completed in 0 seconds
[thread #0]  INFO 2012-02-04 10:45:49,116: Route: DirectCopyRoute
stopped, was consuming from: Endpoint[direct://test]
[thread #0]  INFO 2012-02-04 10:45:49,122: everything is shut down now
(my message)
[main]  INFO 2012-02-04 10:45:49,212: checking to see if stop was
called (my message)

I can live with the sleep in the test - it's only 100ms. :)

Larry

Reply via email to