Closed god-pane closed 5 years ago
如图,我把MQTT Connect放到setUp Thread Group, 其他2个线程里面放置了publish, 最后一个tearDown Thread Group 放置MQTT DisConnect,
实际运行结果,只有MQTT Connect成功,其余的都失败了
Add an 'MQTT Connect' sampler into the same thread group of pub/sub samplers, and add a 'one only control group' as parent of 'MQTT Connect' sampler.
如果使用一个线程的话, pub和sub没有办法并行,比如我下端需要每隔一小时pub设备的基本信息,同时也要sub服务端给的消息做反馈,这样的场景能实现么?
You can add sub sampler with 'sample on - specified elapsed time (ms)', then a sub sampler will be generated with your specified time period, and the thread will not be blocked.
Regarding to your pub sampler, you can add an if controller, the controller will check the timestamp of last publish, and the condition is satisfied only with one hour is passed. You also need to add a post-processor to the pub sampler for recording the timestamp of publish - beanshell script is recommended.
设备sub消息的时间是不定的,因为不知道服务端何时会有需求, 所以我想的是用一个线程, 一直监听
设备sub消息的时间是不定的,因为不知道服务端何时会有需求, 所以我想的是用一个线程, 一直监听
No problem. You could check the response of sub sampler. If no contents returned in the sampler, then the sub sampler result is empty.
能上图 给个列子嘛? 谢谢!
最重要的是我的sub不是一次行为, 是多次, 不是说我收到一次消息处理后就要把这个sub结束,我希望他一直存在。
In thread group: Loop Count - check Forever
这个地方可以有多个sub吗?
当我写了两个sub以后,发现两个sub收到的消息会混乱, 这个能优化解决吗?
能支持多个sub?@jinfahua
知道了