图形化 MQTT 测试工具 eclipse paho 客户端下载

Graphical MQTT Client Tools
官网
https://www.eclipse.org/paho/components/tool/

官方下载地址

https://repo.eclipse.org/content/repositories/paho-releases/org/eclipse/paho/org.eclipse.paho.ui.app/

目前最新版 1.1.1
在这里插入图片描述

在这里插入图片描述

我是 win10 x64 选择红框处下载

在这里插入图片描述

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,以下是一个简单的 Eclipse Paho MQTT 客户代码,用于连接到 MQTT 代理并发布消息: ```java import org.eclipse.paho.client.mqttv3.*; import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence; public class MQTTClient { public static void main(String[] args) { String topic = "test/topic"; String content = "Hello, World!"; int qos = 2; String broker = "tcp://mqtt.eclipse.org:1883"; String clientId = "JavaSample"; MemoryPersistence persistence = new MemoryPersistence(); try { MqttClient mqttClient = new MqttClient(broker, clientId, persistence); MqttConnectOptions connOpts = new MqttConnectOptions(); connOpts.setCleanSession(true); System.out.println("Connecting to broker: " + broker); mqttClient.connect(connOpts); System.out.println("Connected"); System.out.println("Publishing message: " + content); MqttMessage message = new MqttMessage(content.getBytes()); message.setQos(qos); mqttClient.publish(topic, message); System.out.println("Message published"); mqttClient.disconnect(); System.out.println("Disconnected"); System.exit(0); } catch (MqttException me) { System.out.println("reason: " + me.getReasonCode()); System.out.println("msg: " + me.getMessage()); System.out.println("loc: " + me.getLocalizedMessage()); System.out.println("cause: " + me.getCause()); System.out.println("excep: " + me); me.printStackTrace(); } } } ``` 这个客户连接到 Eclipse 的公共 MQTT 测试代理,并发布一条消息到 "test/topic" 主题。你可以根据你的实际需求进行修改。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值