You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by wi...@apache.org on 2020/03/30 18:26:02 UTC

[incubator-streampipes] branch dev updated: remove Thread.sleep in ActiveMQPublisher

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

wiener 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 cfa1372  remove Thread.sleep in ActiveMQPublisher
cfa1372 is described below

commit cfa137278629fe13665c0d0a0f2744f533b953f9
Author: Patrick Wiener <wi...@fzi.de>
AuthorDate: Mon Mar 30 20:25:44 2020 +0200

    remove Thread.sleep in ActiveMQPublisher
---
 .../org/apache/streampipes/messaging/jms/ActiveMQPublisher.java     | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/streampipes-messaging-jms/src/main/java/org/apache/streampipes/messaging/jms/ActiveMQPublisher.java b/streampipes-messaging-jms/src/main/java/org/apache/streampipes/messaging/jms/ActiveMQPublisher.java
index 7cde0b0..e2e251f 100644
--- a/streampipes-messaging-jms/src/main/java/org/apache/streampipes/messaging/jms/ActiveMQPublisher.java
+++ b/streampipes-messaging-jms/src/main/java/org/apache/streampipes/messaging/jms/ActiveMQPublisher.java
@@ -72,19 +72,13 @@ public class ActiveMQPublisher implements EventProducer<JmsTransportProtocol> {
     String url = protocolSettings.getBrokerHostname() + ":" + protocolSettings.getPort();
     ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(url);
 
-    // TODO fix this
-    // it works but we need a better solution
-    // we should retry to connect when the service is not available immediately
     boolean co = false;
     do {
       try {
-        Thread.sleep(2000);
         this.connection = connectionFactory.createConnection();
         co = true;
       } catch (JMSException e) {
         LOG.error("Trying to connect...", e);
-      } catch (InterruptedException e) {
-        e.printStackTrace();
       }
     } while (!co);