mqtt

How do I create a actor if I subscribe to a specific topic?

雨燕双飞 提交于 2019-12-30 13:34:23
问题 Hi I have some code which includes publish/subscribe and actors. The generic_device class allows me to create other actors. I was wondering how do I create a specific actor from the generic_device class when I subscribe to a topic and if the topic isn't subscribed then no actor is created from the generic_device class. At the moment it is just if a specific message is received then the actor is created. All help appreciated thanks. import logging from datetime import timedelta import time

Send many publish message: Too many publishes in progress Error

丶灬走出姿态 提交于 2019-12-30 11:24:48
问题 Here is paho Async client: client = new MqttAsyncClient(appProps.getProperty("mqtt.broker"), appProps.getProperty("mqtt.clientId"), new MemoryPersistence()); client.setCallback(this); client.connect(null, new IMqttActionListener() { @Override public void onSuccess(IMqttToken imt) { try { client.subscribe(Constants.internalTopics, Constants.internalTopicQOS); } catch (MqttException ex) { ex.printStackTrace(); } } @Override public void onFailure(IMqttToken imt, Throwable thrwbl) { thrwbl

AWS IoT Android application over MQTT throws MqttException (0) - java.io.IOException: Already connected

依然范特西╮ 提交于 2019-12-30 10:19:28
问题 I am trying to use 'Authenticate using Cognito-Identity with Cognito user pool' in my Android application. My Cognito user pool authentication works well, when I run that separately and I had seen a JWTToken as well. When I run the the 'PubSub' sample application with Unauthenticated role, it worked as expected. When I integrate these two features in one application, the application threw following error. W/System.err: MqttException (0) - java.io.IOException: Already connected W/System.err:

MQTT - Is there a way to check if the client is still connected

倾然丶 夕夏残阳落幕 提交于 2019-12-30 08:36:31
问题 Is there a way to check if the client is still connected to the MQTT broker? Something like if client.isConnected(): # for example # if True then do stuff Edit: There was instance where my Raspberry Pi stopped receiving from the client although it was still (from the look of it, the code was still showing updated results) running. Here is the code since I may be doing something wrong: client = mqtt.Client() client.connect(address, 1883, 60) while True: data = getdata() client.publish("$ahmed/

Direct MQTT vs MQTT over WebSocket [closed]

天大地大妈咪最大 提交于 2019-12-29 10:36:29
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 6 months ago . What are merits of MQTT over WebSocket compared to direct MQTT? I'm considering using MQTT in my project and so I want to know why some people choose MQTT over WebSocket instead of direct MQTT. 回答1: You should only need to run MQTT over websockets if you intend to publish

Direct MQTT vs MQTT over WebSocket [closed]

筅森魡賤 提交于 2019-12-29 10:36:11
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 6 months ago . What are merits of MQTT over WebSocket compared to direct MQTT? I'm considering using MQTT in my project and so I want to know why some people choose MQTT over WebSocket instead of direct MQTT. 回答1: You should only need to run MQTT over websockets if you intend to publish

Spring Integration MQTT Subscriber (paho) stops processing messages

主宰稳场 提交于 2019-12-29 09:49:07
问题 We're experiencing an issue with one of our MQTT subscribers in Spring integration (4.0.3.RELEASE running on Tomcat 7 with the Paho MQTT Client 0.4.0). The issue is with a subscriber on a heavily used topic (lots of messages). The devices sending the messages to the topic are devices in the field connecting over GPRS. Spring integration and the broker (Mosquitto) are running on the same server. The issue seems to appear after doing a couple of redeploys on the Tomcat without restarting the

java模拟MQTT的发布,订阅

耗尽温柔 提交于 2019-12-27 08:06:09
MQTT目录:    MQTT简单介绍 window安装MQTT服务器和client java模拟MQTT的发布,订阅 window安装MQTT服务器,我这里下载了一个 apache-apollo-1.7.1-windows-distro.zip   下面简单说一下我的安装步骤:     第一步,下载zip包:解压到随意文件夹            第二步:创建实例:我已经创建过了,就不回车了,如果第一次创建,直接回车,在bin目录下会出现实例名的文件夹,如图“”              创建成功:            第三步:进入该实例下,修改对外端口:            第四步:启动:            第五步:web页面访问:  http://127.0.0.1:61680/ (因为我已经操作成功,所以不需要输入密码,第一次需要输入密码的 admin=password)          客户端连接测试:     在这我选择的是 org.eclipse.paho.ui.app-1.0.2-win32.win32.x86_64 (基于ecplise rpc插件制作)或者去官网下载,选择适合自己系统的版本 https://repo.eclipse.org/content/repositories/paho-releases/org/eclipse/paho/org

微信小程序连接MQTT

泪湿孤枕 提交于 2019-12-26 16:29:07
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 微信小程序连接MQTT 之前封装所引入的 paho-mqtt.js 在微信小程序中运行,提示浏览器不支持,后来在网上找了些方法,结果一直连不上。以下是我经过测试引入到项目中的。 方法 1. 引入修改后的 paho-mqtt.js /******************************************************************************* * Copyright (c) 2013 IBM Corp. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * and Eclipse Distribution License v1.0 which accompany this distribution. * * The Eclipse Public License is available at * http://www.eclipse.org/legal/epl-v10.html * and the Eclipse Distribution

Schema issue with ApacheBahir Stuctured Streaming connector on ApacheSpark streaming

眉间皱痕 提交于 2019-12-25 09:17:41
问题 I'm trying to hook-up an Apache Spark Structured Stream to a MQTT topic (IBM Watson IoT Platform on IBM Bluemix in this case). I'm creating the structured stream as follows: val df = spark.readStream .format("org.apache.bahir.sql.streaming.mqtt.MQTTStreamSourceProvider") .option("username","<username>") .option("password","<password>") .option("clientId","a:vy0z2s:a-vy0z2s-zfzzckrnqf") .option("topic", "iot-2/type/WashingMachine/id/Washer02/evt/voltage/fmt/json") .load("tcp://vy0z2s.messaging