-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send ServerEvent when server startup has finished #4861
Send ServerEvent when server startup has finished #4861
Conversation
There is a LOT of value in this one-line PR.
|
@jonbartels Maybe I'm not understanding all of your bullet points, but to me, only the first one (timing startup) is particularly meritorious. I say this because there is already an endpoint that returns the server status (GET api/server/status) and when it returns @tonygermano @jonbartels Would one/both of you mind creating an issue to go with this PR and detail the use case(s) for it? |
I created an issue with the first point (which I think is enough) and also the third point. I agree that if you are polling (especially externally) to see if the server is ready, monitoring changes in the events is likely not the best solution (unless you are doing it at the database level, maybe?) |
For my 2nd and 3rd points - If MC fires an event then an event listener can be registered. This is then a "push" operation instead of a "poll" operation as with the #4870 serves my use cases and examples. Tony did a good job writing that up. |
Thanks for doing that 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This solves the use cases stated in #4861
@tonygermano Thank you for your Pull Request. We are interested in considering your contribution but before it can be included in an official branch or release, we need to receive a signed copy of our Contributor License Agreement. Please review the Source Code Contribution page for more details and then sign and return the agreement as instructed. NOTE: since we are also looking at #4868, you can sign just one release form and list both pull requests if you want. |
Same for this one @tonygermano. We need the contributor's agreement signed this month for planning purposes for 4.3. Thanks in advance |
ba350be
into
nextgenhealthcare:pr4861-server-event-startup-finished
I'm curious about this:
How are you supposed to call a server status endpoint before the server has started? I guess you can just poll the expected endpoint with a short timeout and keep trying until you get a "0" back, eh? |
connect/server/src/com/mirth/connect/server/Mirth.java Lines 351 to 354 in e0db549
Shows the conditions. The MC webserver (so basic API calls) is started before the actual engine is started. Then plugins, deployments, alerts, and some other gubbins. Startup isn't considered done until here connect/server/src/com/mirth/connect/server/Mirth.java Lines 398 to 399 in e0db549
|
An event is created early in the startup process, but there is not an event sent when startup completes.
resolves #4870