Comments (15)
Please refer to comment #5 (comment) for similar question.
Also, we're developing a new feature to control the received message precisely which was mentioned in #10 . E.g, sub sampler will be produced on receiving x (x can be configured to 1 ~ n) of message. The feature is still under testing. To try it, you can checkout code from timer_sub branch, and build the JAR by yourself.
from mqtt-jmeter.
我要模拟即连即挺的情况,是将Connection keep time 参数设置为0吗? 关闭脚步就停止发包,下线了。
from mqtt-jmeter.
Connection sampler主要用于模拟背景连接,除了ping包不发送任何别的数据。如果模拟即连即停,不发送数据的话,可以按照你说的这样做。不知道这是模拟的什么样的场景?
from mqtt-jmeter.
按照目前的实现方式,Connection keep time设置0,就是连接建立后立即正常disconnect,这样就没有机会发ping包了。你可以看到sampler很快执行完(连接建立的花费时间其实很短)。
在Connection keep time != 0的情况下,如果你在GUI里点击stop按钮来停止脚本,插件会感知到并主动disconnect再结束执行; 如果以其它方式强行关闭脚本,可能要依靠服务器端感知客户端断连并清理,问题也不大。
from mqtt-jmeter.
这个地方默认是1800s 即30分钟, keep alive默认为300s 即5分钟, 我正常连接成功后,停止脚本,但是心跳包根本没有停止发送,还是每隔5分钟发一次,导致我再次开启脚步来连接时,不能连接成功,提示连接已存在了。我只能关闭jmeter来解决这个问题。
from mqtt-jmeter.
你是怎么停止脚本的?你说的情况好像连接并没有断开,可以设法从server端查看连接状况确认一下。
from mqtt-jmeter.
from mqtt-jmeter.
该问题是 开始脚本(正常建立连接), 然后再停止脚本,多重复了几次,就出现。
from mqtt-jmeter.
我确认一下:你现在是用的缺省的keep time=1800s, keep alive=300s? 然后GUI上点开始、结束,重复几次就有没断开的连接,是吧?
我们可能需要查看一下jmeter.log, 看disconnect是不是没有做成功。
另外,如果你不关心保持背景连接,即连即停,用keep time=0有什么问题吗? 为什么要手工停止脚本运行。你的测试场景我们不是特别明白。
from mqtt-jmeter.
keep time=0,没有问题,是即连即停。 手工停止脚本只是在做测试。
符合我这边最终场景是:客户端上线后,先publish,然后subscribe,再根据subscribe返回不同的信息publish,然后我还要操作一些http请求,验证客户端的publish信息。
from mqtt-jmeter.
了解。subscribe时选取合适的采样退出条件(可能是按收到的消息数=1),再分析返回的消息,做下一步的publish就可以了。
from mqtt-jmeter.
还有在循环控制器下面先Connection Sampler,然后再添加一个pub Sampler, 我发现连接成功后,pub Sampler根本没有执行
from mqtt-jmeter.
pub和sub里面都隐含了建立连接的过程,你不需要在pub前面放一个Connection Sampler.
Connection Sampler是用于构造背景长连接,你要是需要,可以把connection sampler放到一个单独的thread group里面。
from mqtt-jmeter.
明白了
from mqtt-jmeter.
谢谢
from mqtt-jmeter.
Related Issues (20)
- Support for AWS IOT CORE HOT 2
- support to publish with file instead of message HOT 1
- How to configure the plugin so JMeter can keep a long connection with emqx broker HOT 1
- Session expired right after the connection established HOT 1
- exception in mqtt sub sampler
- server.exitaftertest=true not working
- When server had some error, after client reconnect success, cann't receive any message HOT 1
- mqtt ssl :Response message:Failed to establish Connection null. HOT 2
- Auto reconnect does not work with authentication or if the reconnect max attempts is set to -1 HOT 1
- An error will be reported if the content sent by the payload contains Chinese
- The MQTT Connect Sampler Protocols is missing the 'Trust Key Store(*.jks)' input field HOT 2
- MQTT v5.0 support for jmeter plugin HOT 1
- Cannot establish different mqtt connections in loops HOT 2
- emqx 服务器重启后, mqtt 客户端重连时使用了不同的用户名和密码,导致连接不正常 HOT 1
- How to modify the encoding of payloads content HOT 1
- 如何关闭ssl校验,或者忽略ssl证书错误 HOT 3
- Question: Does it possible to set ContentType for Payload? HOT 1
- JSON payload Support
- The specified number of reconnection attempts in "MQTT Connect Sampler" does not work
- 测试emqx的mqtt消息转发, 接收消息的一直下降 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mqtt-jmeter.