From 1a9a3468f4cccce01becd543ae85c700e6f1fe93 Mon Sep 17 00:00:00 2001 From: Aaron Ghebretinsae Date: Wed, 24 Jan 2024 14:25:49 -0500 Subject: [PATCH 1/2] added appropriate getters and setters for HeartbeatEntity class in HeartbeatRequestBody.java. updated EventMeshHttpConsumer.java to access aforementioned variables using correct setters. Updated HeartbeatProcessor.java to access aforementioned variables using correct getters. --- .../body/client/HeartbeatRequestBody.java | 44 ++++++++++++++++--- .../http/processor/HeartBeatProcessor.java | 4 +- .../http/consumer/EventMeshHttpConsumer.java | 4 +- 3 files changed, 43 insertions(+), 9 deletions(-) diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/body/client/HeartbeatRequestBody.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/body/client/HeartbeatRequestBody.java index ea6b1c3494..03e00e9a40 100644 --- a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/body/client/HeartbeatRequestBody.java +++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/body/client/HeartbeatRequestBody.java @@ -66,12 +66,46 @@ public Map toMap() { return map; } - @ToString + @Data public static class HeartbeatEntity { - public String topic; - public String serviceId; - public String url; - public String instanceId; + private String topic; + private String serviceId; + private String url; + private String instanceId; + + public String getTopic() { + return topic; + } + + public void setTopic(String topic) { + this.topic = topic; + } + + public String getServiceId() { + return serviceId; + } + + public void setServiceId(String serviceId) { + this.serviceId = serviceId; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getInstanceId() { + return instanceId; + } + + public void setInstanceId(String instanceId) { + this.instanceId = instanceId; + } } + + } diff --git a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/processor/HeartBeatProcessor.java b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/processor/HeartBeatProcessor.java index e4004e2dc7..ed2673fdbe 100644 --- a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/processor/HeartBeatProcessor.java +++ b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/processor/HeartBeatProcessor.java @@ -107,8 +107,8 @@ public void processRequest(final ChannelHandlerContext ctx, final AsyncContext topicList, final String subsc try { final List heartbeatEntities = topicList.stream().map(subscriptionItem -> { final HeartbeatRequestBody.HeartbeatEntity heartbeatEntity = new HeartbeatRequestBody.HeartbeatEntity(); - heartbeatEntity.topic = subscriptionItem.getTopic(); - heartbeatEntity.url = subscribeUrl; + heartbeatEntity.setTopic(subscriptionItem.getTopic()); + heartbeatEntity.setUrl(subscribeUrl); return heartbeatEntity; }).collect(Collectors.toList()); From a22b0c4971c175eece8ba062d3cc53fb1340e803 Mon Sep 17 00:00:00 2001 From: Aaron Ghebretinsae Date: Thu, 25 Jan 2024 13:02:59 -0500 Subject: [PATCH 2/2] --- .../body/client/HeartbeatRequestBody.java | 30 ------------------- 1 file changed, 30 deletions(-) diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/body/client/HeartbeatRequestBody.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/body/client/HeartbeatRequestBody.java index 03e00e9a40..aef3177823 100644 --- a/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/body/client/HeartbeatRequestBody.java +++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/body/client/HeartbeatRequestBody.java @@ -74,37 +74,7 @@ public static class HeartbeatEntity { private String url; private String instanceId; - public String getTopic() { - return topic; - } - public void setTopic(String topic) { - this.topic = topic; - } - - public String getServiceId() { - return serviceId; - } - - public void setServiceId(String serviceId) { - this.serviceId = serviceId; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public String getInstanceId() { - return instanceId; - } - - public void setInstanceId(String instanceId) { - this.instanceId = instanceId; - } }