aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/main')
-rw-r--r--main/src/main/java/org/onap/policy/pap/main/rest/KafkaGetTopicResponse.java (renamed from main/src/main/java/org/onap/policy/pap/main/rest/DmaapGetTopicResponse.java)5
-rw-r--r--main/src/main/java/org/onap/policy/pap/main/rest/PolicyComponentsHealthCheckProvider.java18
-rw-r--r--main/src/main/resources/application.yaml20
3 files changed, 22 insertions, 21 deletions
diff --git a/main/src/main/java/org/onap/policy/pap/main/rest/DmaapGetTopicResponse.java b/main/src/main/java/org/onap/policy/pap/main/rest/KafkaGetTopicResponse.java
index 82886509..dd63a507 100644
--- a/main/src/main/java/org/onap/policy/pap/main/rest/DmaapGetTopicResponse.java
+++ b/main/src/main/java/org/onap/policy/pap/main/rest/KafkaGetTopicResponse.java
@@ -1,6 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2021 Bell Canada. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,12 +27,12 @@ import lombok.Setter;
import lombok.ToString;
/**
- * Class to capture get topic response from dmaap.
+ * Class to capture get topic response from kafka.
*/
@Getter
@Setter
@ToString
-public class DmaapGetTopicResponse {
+public class KafkaGetTopicResponse {
private List<String> topics;
}
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 02d27605..32d43143 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, 2022-2023 Nordix Foundation.
+ * Copyright (C) 2019-2020, 2022-2024 Nordix Foundation.
* Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2020-2022 Bell Canada. All rights reserved.
* ================================================================================
@@ -204,8 +204,8 @@ public class PolicyComponentsHealthCheckProvider {
HealthCheckReport clientReport;
try {
Response resp = httpClient.get();
- if (httpClient.getName().equalsIgnoreCase("dmaap")) {
- clientReport = verifyDmaapClient(httpClient, resp);
+ if (httpClient.getName().equalsIgnoreCase("kafka")) {
+ clientReport = verifyKafkaClient(httpClient, resp);
} else {
clientReport = replaceIpWithHostname(resp.readEntity(HealthCheckReport.class), httpClient.getBaseUrl());
}
@@ -244,12 +244,12 @@ public class PolicyComponentsHealthCheckProvider {
return report;
}
- private HealthCheckReport verifyDmaapClient(HttpClient httpClient, Response resp) {
- DmaapGetTopicResponse dmaapResponse = resp.readEntity(DmaapGetTopicResponse.class);
- var topicVerificationStatus = (dmaapResponse.getTopics() != null
- && dmaapResponse.getTopics().contains(topicPolicyPdpPap));
- String message = (topicVerificationStatus ? "PAP to DMaaP connection check is successful"
- : "PAP to DMaaP connection check failed");
+ private HealthCheckReport verifyKafkaClient(HttpClient httpClient, Response resp) {
+ KafkaGetTopicResponse kafkaResponse = resp.readEntity(KafkaGetTopicResponse.class);
+ var topicVerificationStatus = (kafkaResponse.getTopics() != null
+ && kafkaResponse.getTopics().contains(topicPolicyPdpPap));
+ String message = (topicVerificationStatus ? "PAP to Kafka connection check is successful"
+ : "PAP to Kafka connection check failed");
int code = (topicVerificationStatus ? resp.getStatus() : 503);
return createHealthCheckReport(httpClient.getName(), httpClient.getBaseUrl(), code,
topicVerificationStatus, message);
diff --git a/main/src/main/resources/application.yaml b/main/src/main/resources/application.yaml
index 2a3d1620..12716072 100644
--- a/main/src/main/resources/application.yaml
+++ b/main/src/main/resources/application.yaml
@@ -43,25 +43,25 @@ pap:
topicSources:
- topic: ${pap.topic.pdp-pap.name}
servers:
- - message-router
- topicCommInfrastructure: dmaap
+ - kafka
+ topicCommInfrastructure: NOOP
fetchTimeout: 15000
- topic: ${pap.topic.heartbeat.name}
effectiveTopic: ${pap.topic.pdp-pap.name}
consumerGroup: policy-pap
servers:
- - message-router
- topicCommInfrastructure: dmaap
+ - kafka
+ topicCommInfrastructure: NOOP
fetchTimeout: 15000
topicSinks:
- topic: ${pap.topic.pdp-pap.name}
servers:
- - message-router
- topicCommInfrastructure: dmaap
+ - kafka
+ topicCommInfrastructure: NOOP
- topic: ${pap.topic.notification.name}
servers:
- - message-router
- topicCommInfrastructure: dmaap
+ - kafka
+ topicCommInfrastructure: NOOP
healthCheckRestClientParameters:
- clientName: api
hostname: policy-api
@@ -77,8 +77,8 @@ pap:
password: zb!XztG34
useHttps: true
basePath: healthcheck
- - clientName: dmaap
- hostname: message-router
+ - clientName: kafka
+ hostname: kafka
port: 3905
useHttps: true
basePath: topics