Return-Path: X-Original-To: apmail-stratos-dev-archive@minotaur.apache.org Delivered-To: apmail-stratos-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8672D17712 for ; Tue, 11 Nov 2014 03:57:44 +0000 (UTC) Received: (qmail 95405 invoked by uid 500); 11 Nov 2014 03:57:44 -0000 Delivered-To: apmail-stratos-dev-archive@stratos.apache.org Received: (qmail 95373 invoked by uid 500); 11 Nov 2014 03:57:44 -0000 Mailing-List: contact dev-help@stratos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stratos.apache.org Delivered-To: mailing list dev@stratos.apache.org Received: (qmail 95363 invoked by uid 99); 11 Nov 2014 03:57:43 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Nov 2014 03:57:43 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id B68609A6CD8; Tue, 11 Nov 2014 03:57:43 +0000 (UTC) From: imesh To: dev@stratos.apache.org Reply-To: dev@stratos.apache.org References: In-Reply-To: Subject: [GitHub] stratos pull request: Fixes for error in publishing artifact updat... Content-Type: text/plain Message-Id: <20141111035743.B68609A6CD8@tyr.zones.apache.org> Date: Tue, 11 Nov 2014 03:57:43 +0000 (UTC) Github user imesh commented on a diff in the pull request: https://github.com/apache/stratos/pull/86#discussion_r20130914 --- Diff: components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/broker/publish/TopicPublisher.java --- @@ -69,48 +70,49 @@ public void publish(Object messageObj, boolean retry) { synchronized (TopicPublisher.class) { - Gson gson = new Gson(); - String message = gson.toJson(messageObj); - boolean published = false; - while (!published) - try { - mqttClient = MQTTConnector.getMQTTConClient(); - - MqttMessage mqttMSG = new MqttMessage(message.getBytes()); - - mqttMSG.setQos(QOS); - MqttConnectOptions connOpts = new MqttConnectOptions(); - connOpts.setCleanSession(true); - mqttClient.connect(connOpts); - mqttClient.publish(topic, mqttMSG); - mqttClient.disconnect(); - published = true; - } catch (Exception e) { - initialized = false; - if (log.isErrorEnabled()) { - log.error("Error while publishing to the topic: " + topic, e); - } - if (!retry) { - if (log.isDebugEnabled()) { - log.debug("Retry disabled for topic " + topic); - } - throw new RuntimeException(e); - } - - if (log.isInfoEnabled()) { - log.info("Will try to re-publish in 60 sec"); - } - try { - Thread.sleep(60000); - } catch (InterruptedException ignore) { - } - } - finally { - - } - } + Gson gson = new Gson(); --- End diff -- Loos like we have an indentation issue here. Can you please correct this? Thanks --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---