You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stratos.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2014/11/11 04:58:34 UTC

[jira] [Commented] (STRATOS-791) MQTT protocol support for the messaging module

    [ https://issues.apache.org/jira/browse/STRATOS-791?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14205912#comment-14205912 ] 

ASF GitHub Bot commented on STRATOS-791:
----------------------------------------

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


> MQTT protocol support for the messaging module
> ----------------------------------------------
>
>                 Key: STRATOS-791
>                 URL: https://issues.apache.org/jira/browse/STRATOS-791
>             Project: Stratos
>          Issue Type: Improvement
>            Reporter: Gayan Gunarathne
>            Assignee: Gayan Gunarathne
>             Fix For: 4.1.0 M1
>
>
> With referring  to the discussion MQTT will be used as messaging protocol.
> [1]Messaging protocol with Stratos python cartridge agent 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)