问题标签 [hivemq]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1457 浏览

java - 线程“主”java.io.IOException 中的异常:sun.security.provider.JavaKeyStore.engineLoad 处的密钥库格式无效(JavaKeyStore.java:658)

我有 mycert.crt 文件,我想使用我的 java 代码连接到服务器。我的标题是异常。我的代码如下:

在我的 java.security 中有 keystore.type=jks 使用这个 mycert.crt 文件我可以使用 mqtt-spy 登录到我的 hivemq 服务器。用户名:abcd 密码:wxyz 安全选项卡-TLS 模式:CA 证书协议:TLSv1 CA 证书文件:mycert.zip 我正在浏览不同的站点,但现在得到了答案。

0 投票
0 回答
938 浏览

c# - 如何在 C# 中使用 M2mqtt libraby 进行认证?

嗨,我正在使用 M2Mqtt C# 库,我想通过安全性连接到 hive MQ 代理。Hive MQ 启用了 ssl,我编辑了 config.xml 以使用 java Key store(.jks) 来启用 ssl。

我正在使用自签名证书。我从我的组织获得了证书,我从中生成了 java 密钥库。

这是需要以下参数的库。

我有连接时传递给 CA.crt 的 root.crt。我应该为客户端证书上传什么,.crt 格式对于 X509 格式是否正确。

//所以经过一番尝试,我得到了以下

我留空了,但我得到了exception connecting to broker。"根据验证程序,远程证书无效。"}

这是MQTT代码

0 投票
2 回答
2362 浏览

java - MQTT Retained messages not received when subscribing same topic from different applications at the same time

TL;DR

When subscribing to the same topic tree with multiple clients at the same time, not all clients receive the retained messages as expected!

in detail / use case

In a real project several applications subscribe (nearly at the same time because they are started in parallel) to the same MQTT topic (with wildcard). The topic contains about 500 retained messages (each in an own sub topic level) which all applications are expected to receive (they are subscribing with QoS 1).

Beside the "configuration" messages also data topics are subscribed with the same MQTT connection. No persisted state is required (and wanted here). Therefore the application instances connect with cleanSession=true.

For my understanding it would be sufficient if the application instances would each connect with a fixed clientId as cleanSession=true should avoid any state handling. But to be really sure that no state is considered a unique MQTT clientId is generated for each connect.

observerd behavior

Unfortunately not all application instances get the retained messages.. Some get no messages at all from the topic - regardless of how long the subscription lasts. I first thought that the maxInflight (client side) or max_queued_messages (server side) configuration might be the reasons, but after increasing both to 500,000 I guess this is not the reasons behind the failure.

reproduction as test

Therefore I created this github project with a repro. There is a unit test class in the repro MqttSubscriptionTest with the test method multiThreadSubscriptionTest. When executing this test some (1000) retained messages will be published first in the @BeforeClass method. After that, 10 instances of a MqttSubscriber class which implements the IMqttMessageListener and Runnable interface will be instantiated and executed. Each MqttSubscriber instance will be executed in an own thread with an own MqttClient instance and will subscribe to the topic tree with the retained messages. This is logged to the console as follows:

The test will wait some time and after that validate the subscriptions. It is expected that each Subscriber received the 1000 retained messages:

Most subscriber received the expected 1000 messages in a very short time (some hundreds ms). But some (here Subscriber-7/8) did not receive a single message (duration is 0 because they never finished). The situation is not better when giving the subscribers more time to receive the messages. They just won't get them.

I have no idea why this happens. No error messages are shown on the MQTT broker or client side. If you can give any help this would be super useful for me, because I dependent on the reliable delivery of retained messages.

Repro on GitHub: FrVaBe/MQTT/mqtt-client-showcase/

  • I tested with a local EMQ and HiveMQ broker. If you want to run the test you need to run a broker on your machine at localhost:1883 or change the configuration in the test class.
  • I use the Eclipse Paho Java Client MQTT
  • I subscribe with cleanSession=true because I do not want to have any state (the connection is used to subscribe to several topics and the delivery of missed messages is not wanted)
0 投票
1 回答
2167 浏览

rabbitmq - 消息代理之间有什么区别?

我对不同的消息代理感到困惑。

我的设备正在使用 MQTT。到目前为止,我已经查看了 HiveMQ、IBM Messagesight、RabbitMQ、google pub and sub、AWS SQS。

HiveMQ(MQTT 消息代理)和 RabbitMQ(或 pub and sub,SQS)有什么区别?

除了协议和成本可能不同之外,它们的功能有什么不同吗?还有一个问题,IBM messagesight 是消息代理,它与 google pub and sub 或 rabbit 有什么不同吗?

我找不到有关messagesight的任何信息。

0 投票
2 回答
1040 浏览

mqtt - MQTT 使用 URL HIVEMQ 发布

如何使用 URL 发布到 MQTT 主题。

即“ http://127.0.0.1/cmnd/power/on ”将“ on ”发送到“ power ”主题。

ps:我正在使用 HiveMQ

0 投票
2 回答
169 浏览

c# - HiveMQ 使用 M2Mqtt 共享订阅

如果订阅者的主题为$share/group/my_topic,它不会收到任何消息,但如果我将主题更改为/my_topic- 一切正常。

M2Mqtt 似乎不支持共享订阅。有解决方法吗?我还需要持久性来处理共享订阅。

如果没有解决方法,欢迎提供其他库!

0 投票
1 回答
102 浏览

websocket - 无法在远程服务器上启动 hivemq 服务器?

我制作了两台服务器,一台是虚拟测试服务器,另一台是我的 django 项目正在运行的地方。我能够在我的虚拟服务器上运行 hivemq 服务器,但是当我尝试在我的项目服务器上运行它时它会引发错误。

0 投票
0 回答
203 浏览

sockets - 将数据发布到 HiveMQ 服务器时出现 "cleaning in abortwrite for socket 3" 错误

我有两台单独的机器,其中一台设置为发布者客户端,另一台设置为 HiveMQ 代理服务器。当我执行我的发布者代码(将数据发布到 HiveMQ 代理)时,它正在中止并出现错误“正在为套接字 3 清除中止写入”。我不知道我做错了什么以及如何解决这个问题。

0 投票
1 回答
85 浏览

user-interface - HiveMQ 中 Web UI 的 SSL/TLS

我正在尝试在 CentOS 上为 HiveMQ 3.4.2 的 Web UI 启用 ssl 连接。我已经像这样更改了 config.xml 文件

我正在使用这一行创建自签名证书:

如果我尝试启动 HiveMQ,我会收到一条错误消息:

2019-03-11 19:19:05,671 WARN - 失败 SslContextFactory@628bd77e(,): java.io.FileNotFoundException: /home (是一个目录) java.io.FileNotFoundException: /home (是一个目录) 在 java.io .FileInputStream.open0(Native Method) at java.io.FileInputStream.open(FileInputStream.java:195) at java.io.FileInputStream.(FileInputStream.java:138) at org.eclipse.jetty.util.resource.FileResource。 org.eclipse.jetty.util.ssl.SslContextFactory.loadKeyStore(Unknown Source) 的 org.eclipse.jetty.util.security.CertificateUtils.getKeyStore(Unknown Source) 的 getInputStream(Unknown Source)。 ssl.SslContextFactory.doStart(Unknown Source) 在 org.eclipse.jetty.util.component.AbstractLifeCycle。在 org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(Unknown Source) 在 org.eclipse.jetty.server 的 org.eclipse.jetty.util.component.ContainerLifeCycle.start(Unknown Source) 开始(未知来源)。 SslConnectionFactory.doStart(Unknown Source) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(Unknown Source) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(Unknown Source) at org.eclipse.jetty。 util.component.ContainerLifeCycle.doStart(Unknown Source) at org.eclipse.jetty.server.AbstractConnector.doStart(Unknown Source) at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(Unknown Source) at org.eclipse.jetty。 server.ServerConnector.doStart(Unknown Source) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(Unknown Source) at org.eclipse.jetty.server.Server.doStart(Unknown Source) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(Unknown Source) at et.aa(Unknown Source) at et.aa(Unknown Source) at com.hivemq.HiveMQServer.b(Unknown Source) at com.hivemq.HiveMQServer.a(Unknown Source) at com.hivemq.HiveMQServer.main(Unknown Source )b(未知来源)在 com.hivemq.HiveMQServer.a(未知来源)在 com.hivemq.HiveMQServer.main(未知来源)b(未知来源)在 com.hivemq.HiveMQServer.a(未知来源)在 com.hivemq.HiveMQServer.main(未知来源)

2019-03-11 19:19:05,672 WARN - 失败 SslConnectionFactory@2fafa7b5{SSL-HTTP/1.1}:java.io.FileNotFoundException:/home(是一个目录) java.io.FileNotFoundException:/home(是一个目录)在 java.io.FileInputStream.open0(Native Method) 在 java.io.FileInputStream.open(FileInputStream.java:195) 在 java.io.FileInputStream.(FileInputStream.java:138) 在 org.eclipse.jetty.util。 resource.FileResource.getInputStream(Unknown Source) at org.eclipse.jetty.util.security.CertificateUtils.getKeyStore(Unknown Source) at org.eclipse.jetty.util.ssl.SslContextFactory.loadKeyStore(Unknown Source) at org.eclipse。 jetty.util.ssl.SslContextFactory.doStart(Unknown Source) at org.eclipse.jetty.util.component.AbstractLifeCycle。在 org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(Unknown Source) 在 org.eclipse.jetty.server 的 org.eclipse.jetty.util.component.ContainerLifeCycle.start(Unknown Source) 开始(未知来源)。 SslConnectionFactory.doStart(Unknown Source) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(Unknown Source) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(Unknown Source) at org.eclipse.jetty。 util.component.ContainerLifeCycle.doStart(Unknown Source) at org.eclipse.jetty.server.AbstractConnector.doStart(Unknown Source) at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(Unknown Source) at org.eclipse.jetty。 server.ServerConnector.doStart(Unknown Source) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(Unknown Source) at org.eclipse.jetty.server.Server.doStart(Unknown Source) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(Unknown Source) at et.aa(Unknown Source) at et.aa(Unknown Source) at com.hivemq.HiveMQServer.b(Unknown Source) at com.hivemq.HiveMQServer.a(Unknown Source) at com.hivemq.HiveMQServer.main(Unknown Source )b(未知来源)在 com.hivemq.HiveMQServer.a(未知来源)在 com.hivemq.HiveMQServer.main(未知来源)b(未知来源)在 com.hivemq.HiveMQServer.a(未知来源)在 com.hivemq.HiveMQServer.main(未知来源)

2019-03-11 19:19:05,672 WARN - 失败的 ServerConnector@181098bf{SSL-HTTP/1.1}{0.0.0.0:8443}:java.io.FileNotFoundException:/home(是一个目录)java.io.FileNotFoundException: /home(是一个目录)在 java.io.FileInputStream.open0(Native Method) 在 java.io.FileInputStream.open(FileInputStream.java:195) 在 java.io.FileInputStream.(FileInputStream.java:138) 在 org .eclipse.jetty.util.resource.FileResource.getInputStream(Unknown Source) at org.eclipse.jetty.util.security.CertificateUtils.getKeyStore(Unknown Source) at org.eclipse.jetty.util.ssl.SslContextFactory.loadKeyStore(Unknown来源)在 org.eclipse.jetty.util.ssl.SslContextFactory.doStart(未知来源)在 org.eclipse.jetty.util.component.AbstractLifeCycle。在 org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(Unknown Source) 在 org.eclipse.jetty.server 的 org.eclipse.jetty.util.component.ContainerLifeCycle.start(Unknown Source) 开始(未知来源)。 SslConnectionFactory.doStart(Unknown Source) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(Unknown Source) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(Unknown Source) at org.eclipse.jetty。 util.component.ContainerLifeCycle.doStart(Unknown Source) at org.eclipse.jetty.server.AbstractConnector.doStart(Unknown Source) at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(Unknown Source) at org.eclipse.jetty。 server.ServerConnector.doStart(Unknown Source) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(Unknown Source) at org.eclipse.jetty.server.Server.doStart(Unknown Source) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(Unknown Source) at et.aa(Unknown Source) at et.aa(Unknown Source) at com.hivemq.HiveMQServer.b(Unknown Source) at com.hivemq.HiveMQServer.a(Unknown Source) at com.hivemq.HiveMQServer.main(Unknown Source )b(未知来源)在 com.hivemq.HiveMQServer.a(未知来源)在 com.hivemq.HiveMQServer.main(未知来源)b(未知来源)在 com.hivemq.HiveMQServer.a(未知来源)在 com.hivemq.HiveMQServer.main(未知来源)

2019-03-11 19:19:05,673 WARN - FAILED org.eclipse.jetty.server.Server@632b5c79: java.io.FileNotFoundException: /home (是一个目录) java.io.FileNotFoundException: /home (是一个目录) 在 java.io.FileInputStream.open0(Native Method) 在 java.io.FileInputStream.open(FileInputStream.java:195) 在 java.io.FileInputStream.(FileInputStream.java:138) 在 org.eclipse.jetty.util .resource.FileResource.getInputStream(Unknown Source) at org.eclipse.jetty.util.security.CertificateUtils.getKeyStore(Unknown Source) at org.eclipse.jetty.util.ssl.SslContextFactory.loadKeyStore(Unknown Source) at org.eclipse .jetty.util.ssl.SslContextFactory.doStart(Unknown Source) at org.eclipse.jetty.util.component.AbstractLifeCycle。在 org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(Unknown Source) 在 org.eclipse.jetty.server 的 org.eclipse.jetty.util.component.ContainerLifeCycle.start(Unknown Source) 开始(未知来源)。 SslConnectionFactory.doStart(Unknown Source) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(Unknown Source) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(Unknown Source) at org.eclipse.jetty。 util.component.ContainerLifeCycle.doStart(Unknown Source) at org.eclipse.jetty.server.AbstractConnector.doStart(Unknown Source) at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(Unknown Source) at org.eclipse.jetty。 server.ServerConnector.doStart(Unknown Source) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(Unknown Source) at org.eclipse.jetty.server.Server.doStart(Unknown Source) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(Unknown Source) at et.aa(Unknown Source) at et.aa(Unknown Source) at com.hivemq.HiveMQServer.b(Unknown Source) at com.hivemq.HiveMQServer.a(Unknown Source) at com.hivemq.HiveMQServer.main(Unknown Source )b(未知来源)在 com.hivemq.HiveMQServer.a(未知来源)在 com.hivemq.HiveMQServer.main(未知来源)b(未知来源)在 com.hivemq.HiveMQServer.a(未知来源)在 com.hivemq.HiveMQServer.main(未知来源)

2019-03-11 19:19:05,673 错误 - 无法启动 Web UI:/home(是一个目录)

我不知道出了什么问题。有人能帮助我吗。

0 投票
1 回答
486 浏览

mqtt - HiveMQ Java 阻塞客户端订阅者不消费任何消息

我正在使用 HiveMQ Java 客户端连接到 HiveMQ 代理。阻塞客户端订阅者不使用任何消息。使用 MQTTBox 发布和订阅工作正常。这是代码。我正在关注 HiveMQ Java 客户端文档

Maven依赖:

我错过了什么吗?任何指针都会非常有帮助。