You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by bo...@apache.org on 2023/10/21 16:16:04 UTC

[streampipes] branch dev updated: refactor: introduce conveniance method for service url (#2064)

This is an automated email from the ASF dual-hosted git repository.

bossenti pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/streampipes.git


The following commit(s) were added to refs/heads/dev by this push:
     new ddecc0d91 refactor: introduce conveniance method for service url (#2064)
ddecc0d91 is described below

commit ddecc0d9122221adb25fe1ae581f92b7b0744b7c
Author: Tim <50...@users.noreply.github.com>
AuthorDate: Sat Oct 21 18:15:58 2023 +0200

    refactor: introduce conveniance method for service url (#2064)
---
 .../model/extensions/svcdiscovery/SpServiceRegistration.java          | 4 ++++
 .../org/apache/streampipes/manager/health/ServiceHealthCheck.java     | 2 +-
 .../org/apache/streampipes/svcdiscovery/SpServiceDiscoveryCore.java   | 2 +-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/extensions/svcdiscovery/SpServiceRegistration.java b/streampipes-model/src/main/java/org/apache/streampipes/model/extensions/svcdiscovery/SpServiceRegistration.java
index 2f731ba74..b1490adfa 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/extensions/svcdiscovery/SpServiceRegistration.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/extensions/svcdiscovery/SpServiceRegistration.java
@@ -145,6 +145,10 @@ public class SpServiceRegistration {
     return scheme;
   }
 
+  public String getServiceUrl() {
+    return getScheme() + "://" + getHost() + ":" + getPort();
+  }
+
   public void setScheme(String scheme) {
     this.scheme = scheme;
   }
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/health/ServiceHealthCheck.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/health/ServiceHealthCheck.java
index dadfe9c64..fda4741a3 100644
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/health/ServiceHealthCheck.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/health/ServiceHealthCheck.java
@@ -89,7 +89,7 @@ public class ServiceHealthCheck implements Runnable {
   }
 
   private String makeHealthCheckUrl(SpServiceRegistration service) {
-    return service.getScheme() + "://" + service.getHost() + ":" + service.getPort() + service.getHealthCheckPath();
+    return service.getServiceUrl() + service.getHealthCheckPath();
   }
 
   private List<SpServiceRegistration> getRegisteredServices() {
diff --git a/streampipes-service-discovery/src/main/java/org/apache/streampipes/svcdiscovery/SpServiceDiscoveryCore.java b/streampipes-service-discovery/src/main/java/org/apache/streampipes/svcdiscovery/SpServiceDiscoveryCore.java
index ea3ff85d5..8170c36ad 100644
--- a/streampipes-service-discovery/src/main/java/org/apache/streampipes/svcdiscovery/SpServiceDiscoveryCore.java
+++ b/streampipes-service-discovery/src/main/java/org/apache/streampipes/svcdiscovery/SpServiceDiscoveryCore.java
@@ -68,7 +68,7 @@ public class SpServiceDiscoveryCore implements ISpServiceDiscovery {
   }
 
   private String makeServiceUrl(SpServiceRegistration service) {
-    return service.getScheme() + "://" + service.getHost() + ":" + service.getPort();
+    return service.getServiceUrl();
   }
 
   private boolean allFiltersSupported(SpServiceRegistration service,