Keeping host process alive #453
Unanswered
edfenergy-richardcannock
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Normally, when you start an initiator, your start a thread, that will be a reconnect loop ( |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In order to keep an initiator alive within a main process, what is the recommended method?
In our initiator application, we are connecting to an external exchange, and are required to send an period heatbeat message to indicate the application is still running and the application should be durable and run 24/7 ideally.
Blocking the main thread after starting the initiator with an infinite while loop ala:
initiator.start();
while(true)
{
thread.sleep(1000); // or whatever really.
}
initiator.stop();
seems inelegant, but i'm not sure of how else to implement this in a production application.
without the while loop, the application just exits. I assume this is because the initator app is somehow launched on a background thread?
This may be more of a question around generic Java process programming per se but seems relevant in quickfix j application so asking here.
Any advice gratefully received. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions