I need the application's main thread to sleep for some time while the reapers clear the remaining groups in the SimpleMessageStore.
I've come to the conclusion that when the message stores are empty I can consider the processing mostly complete. I may sleep for few more seconds just to be sure.
I am trying out some code that looks like this.
The system is end to end, that is, there is no reply channel. The results of the processing are written to a file.Code:while(referencedObjectsMessageStore.iterator().hasNext() || batchMessageStore.iterator().hasNext()) { System.out.println("Checking if the message stores are cleared..."); Thread.sleep(1000); }
Does this seems reasonable? Is there another approach?
Many Thanks,
Matt


Reply With Quote