emqx / mqtt-jmeter

MQTT JMeter Plugin
https://www.emqx.com/en
Apache License 2.0
447 stars 193 forks source link

按照#5你给的建议,sub Sampler后面跟的是pub Sampler, 会再次去建立连接,报错如下图 #13

Closed god-pane closed 6 years ago

god-pane commented 7 years ago

image

rende2005 commented 7 years ago

你的脚本方便发出来吗?email: rendangen@xmeter.net 我们看看这个执行序列哪里有问题。

rende2005 commented 7 years ago

还有,你用的插件是哪个版本?emqtt服务器设置了用户认证吗?

god-pane commented 7 years ago

有些不方便,插件的版本是v0.92_beta,emqtt服务器设置了用户认证的,就跟我前面那个问题一样, 我之前是在pub Sampler 前面加了一个connection Sampler,所以pub Sampler不能执行, 现在是有了sub Sampler,然后再根据返回的内容去执行Pub Sampler, PubSampler 不能执行,从日志上看是执行了sub Sampler后连接不会断开,然后再去执行pub Sampler 又会去执行connect,导致返回日志用户名或者密码错误

god-pane commented 7 years ago

并且,日志返回的错误信息是错误的,应该返回连接已存在

rende2005 commented 7 years ago

最新的代码在timer_sub分支, 你要不自己build一个jar, 重新试试?

如果在sub和pub中你的clientID是相同的,sub做完了并不会disconnect(因为它还希望继续接收消息),这时,pub又以相同的clientID试图连接,就会有问题。你可以在clientID后面跟上"random string suffix"吗?sub, pub的插件里都有这个选项。

god-pane commented 7 years ago

clientID是相同的, 不会改变。 如果跟上“random string suffix”,都不能正常连接。

rende2005 commented 7 years ago

那不好意思,我们目前的实现暂时不能支持你的场景。 我们也许要在语义上重新考虑连接,发布,订阅的关系及对应实现。

god-pane commented 7 years ago

后续会修改么? 实际环境中, 我们这种情况也应该比较多。

jinfahua commented 6 years ago

现在加了一个选项,控制是否共享连接,该功能已经支持了。