Skip to content
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

PAYARA-3829 MicroProfile Healthcheck 2.1 implementation #4254

Merged
merged 3 commits into from Oct 21, 2019

Conversation

@jGauravGupta
Copy link
Contributor

jGauravGupta commented Oct 6, 2019

Description

MicroProfile Healthcheck 2.0 and 2.1 implementation:

  • Message body of Health check response was modified, outcome and state replaced by status [Breaking Change]
  • Introduction of Health checks for @Liveness and @Readiness on /health/ready and /health/live endpoints
  • To enable the backward compatibility (outcome and state not replaced by status in JSON payload) of /health endpoint set the value of MP_HEALTH_BACKWARD_COMPATIBILITY_ENABLED MP config property to true.
  • /health is deprecated and return combines Health checks data of @Liveness , @Readiness and @Health.

Important Info

Dependant PRs

payara/MicroProfile-TCK-Runners#59

Testing

New tests

Microprofile HealthCheck TCK v2.1

Test suites executed

  • Payara Microprofile TCKs Runner - HealthCheck TCK v1.0 where mp.health.enable-backward-compatibility=true
  • Payara Microprofile TCKs Runner - HealthCheck TCK v2.1
@jGauravGupta jGauravGupta added this to the 5.194 milestone Oct 6, 2019
@jGauravGupta jGauravGupta requested a review from Pandrex247 Oct 6, 2019
Copy link
Contributor

jbee left a comment

I only have a rough understanding of MP Health so don't take my comments as gospel. It might just be me being confused or picky. What I would like to see overall is a nicer more consistent handling of the 3 types of checks where the type specific part is extracted to e.g. the enum so that the rest of the code can be generic to avoid repeatedly making switches or if-else blocks doing slightly different things for the 3 types we have. Some of my suggestions might help to understand what I mean but I don't think just following all of them would give something fully consistent either. They are more thoughts I had when looking at the particular situations.

@jGauravGupta jGauravGupta force-pushed the jGauravGupta:PAYARA-3829 branch from 0d5443c to 6af77e0 Oct 9, 2019
@jbee
jbee approved these changes Oct 9, 2019
…named to MP_HEALTH_BACKWARD_COMPATIBILITY_ENABLED
@jGauravGupta

This comment has been minimized.

Copy link
Contributor Author

jGauravGupta commented Oct 10, 2019

jenkins test please

Copy link
Member

Pandrex247 left a comment

Looks good, but one quibble.

Tested using my MicroProfileOnMicro app deployed against DAS (after updating health example to 2.1)

@PostConstruct
public void postConstruct() {
if (events == null) {
events = Globals.getDefaultBaseServiceLocator().getService(Events.class);
}
events.register(this);
this.backwardCompEnabled = ConfigProvider.getConfig()

This comment has been minimized.

Copy link
@Pandrex247

Pandrex247 Oct 16, 2019

Member

Should this also be checked on each invocation?
As it is, it's not dynamic which slightly defeats one of the purposes of MP Config.

This comment has been minimized.

Copy link
@jGauravGupta

jGauravGupta Oct 17, 2019

Author Contributor

I purposely added this snippet to PostConstruct method instead of each invocation for very minor optimization. Do you think, end-user will need to change MP_HEALTH_BACKWARD_COMPATIBILITY_ENABLED property value dynamically?

This comment has been minimized.

Copy link
@Pandrex247

Pandrex247 Oct 17, 2019

Member

In 95% of cases, probably not.
But it's the fact that by being only checked in the postconstruct it essentially means that a restart is required if you want to change this. We can't however actually indicate that, because since it's MP config the option can be defined outside of Payara, so we have no way to check if it has changed except by, well, running this exact check :P

It's probably fine as is, we'd just need to make sure to explicitly document this case.

@MarkWareham MarkWareham merged commit b590f73 into payara:master Oct 21, 2019
58 checks passed
58 checks passed
Payara Quick Build and Test Quick build and test passed!
Details
security/snyk - api/payara-api/pom.xml (payara-ci) No new issues
Details
security/snyk - api/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/admin/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/admingui/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/ant-tasks/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/appclient/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/batch/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/common/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/concurrent/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/connectors/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/core/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/deployment/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/distributions/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/ejb/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/extras/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/featuresets/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/flashlight/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/grizzly/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/ha/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/installer/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/jdbc/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/jms/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/load-balancer/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/orb/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/osgi-platforms/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/packager/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/payara-appserver-modules/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/persistence/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/registration/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/resources/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/security/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/tests/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/transaction/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/web/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/webservices/pom.xml (payara-ci) No new issues
Details
security/snyk - copyright/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/admin/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/cluster/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/common/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/core/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/deployment/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/diagnostics/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/distributions/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/flashlight/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/grizzly/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/hk2/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/osgi-platforms/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/packager/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/payara-modules/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/resources-l10n/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/resources/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/security/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/test-utils/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/tests/pom.xml (payara-ci) No new issues
Details
security/snyk - pom.xml (payara-ci) No new issues
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.