X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=main%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpap%2Fmain%2Frest%2FPolicyComponentsHealthCheckProvider.java;h=4da802dfbb159afab3a781bf389fb9cc5cf0d54d;hb=ce1e7de6148c00b00a2a48b0c2504fc8918db9dc;hp=53f05a15f42bd19a15dfb6febcde5d85bf56a94c;hpb=6aa64b948942b402b496b84b89186bcd276ce04c;p=policy%2Fpap.git diff --git a/main/src/main/java/org/onap/policy/pap/main/rest/PolicyComponentsHealthCheckProvider.java b/main/src/main/java/org/onap/policy/pap/main/rest/PolicyComponentsHealthCheckProvider.java index 53f05a15..4da802df 100644 --- a/main/src/main/java/org/onap/policy/pap/main/rest/PolicyComponentsHealthCheckProvider.java +++ b/main/src/main/java/org/onap/policy/pap/main/rest/PolicyComponentsHealthCheckProvider.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2019-2020 Nordix Foundation. + * Copyright (C) 2019-2020, 2022 Nordix Foundation. * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2020-2022 Bell Canada. All rights reserved. * ================================================================================ @@ -88,6 +88,9 @@ public class PolicyComponentsHealthCheckProvider { @Value("${server.port}") private int port; + @Value("${pap.topic.pdp-pap.name:POLICY-PDP-PAP}") + private String topicPolicyPdpPap; + /** * This method is used to initialize clients and executor. */ @@ -244,8 +247,8 @@ public class PolicyComponentsHealthCheckProvider { private HealthCheckReport verifyDmaapClient(HttpClient httpClient, Response resp) { DmaapGetTopicResponse dmaapResponse = resp.readEntity(DmaapGetTopicResponse.class); var topicVerificationStatus = (dmaapResponse.getTopics() != null - && dmaapResponse.getTopics().contains(PapConstants.TOPIC_POLICY_PDP_PAP)); - String message = (topicVerificationStatus ? "PAP to DMaaP connection check is successfull" + && dmaapResponse.getTopics().contains(topicPolicyPdpPap)); + String message = (topicVerificationStatus ? "PAP to DMaaP connection check is successful" : "PAP to DMaaP connection check failed"); int code = (topicVerificationStatus ? resp.getStatus() : 503); return createHealthCheckReport(httpClient.getName(), httpClient.getBaseUrl(), code,