You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ze...@apache.org on 2021/10/01 09:43:58 UTC

[incubator-streampipes] branch dev updated: [hotfix] Fix stop adapters with multiple connect workers

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

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


The following commit(s) were added to refs/heads/dev by this push:
     new 710e004  [hotfix] Fix stop adapters with multiple connect workers
710e004 is described below

commit 710e004c66b17dd27027fd41ad2c7a96fd8a8073
Author: Philipp Zehnder <ze...@fzi.de>
AuthorDate: Fri Oct 1 11:43:29 2021 +0200

    [hotfix] Fix stop adapters with multiple connect workers
---
 .../org/apache/streampipes/rest/impl/connect/AdapterResource.java   | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/AdapterResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/AdapterResource.java
index aa1b9ce..e1009e0 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/AdapterResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/AdapterResource.java
@@ -85,9 +85,11 @@ public class AdapterResource extends AbstractAdapterResource<AdapterMasterManage
     @JacksonSerialized
     @Path("/{id}/stop")
     @Produces(MediaType.APPLICATION_JSON)
-    public Response stopAdapter(@PathParam("id") String adapterId) {
+    public Response stopAdapter(@PathParam("id") String adapterId) throws NoServiceEndpointsAvailableException {
         try {
-            managementService.stopStreamAdapter(adapterId, getAdapterDescription(adapterId).getSelectedEndpointUrl());
+            AdapterDescription adapterDescription = getAdapterDescription(adapterId);
+            String workerBaseUrl = workerUrlProvider.getWorkerBaseUrl(adapterDescription.getAppId());
+            managementService.stopStreamAdapter(adapterId, workerBaseUrl);
             return ok(Notifications.success("Adapter started"));
         } catch (AdapterException e) {
             LOG.error("Could not stop adapter with id " +adapterId, e);