Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MQTT Sub Sampler: Timeout Option for Sample on 'Number or received messages' #125

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

br41nst0rm
Copy link

@br41nst0rm br41nst0rm commented Jun 3, 2022

Hi,
i think a timeout option is missing in the 'MQTT Sub Sampler' with SampleOnCondition set to 'Number or received messages'.
It basicly deadlocks a thread when awaited messages never arrive, or, respectively, was not send back in the first place ..for who knows what reasons.

With our customer we have usecases were we need to measure the time it takes from publishing a messages and receiving a response on different topics (with processing backends involved).

Script would do something like this:
thread1 publishes a message on topic1 -> a backend system receive and processes the message and sends a message/response to topic2 -> thread1 meanwhile subscribed to topic2 and waits for that message/response.

We want to be able to at least measure the time from publishing the message on topic1 to receiving the response on topic2. Considering the backend could also have issues and may not send a response at all, which would be a problematic situation which needs to be handled like an error. But, when thread1 that subscribed to topic2 would then wait basically forever for that one message/response to arrive and those the thread actually is caught in a deadlock situation and no error is logged.

So, for that, I think the easiest thing is to implement a [optional] timeout option, were, when the sampler runs into that timeout the sampler fails and reports an error.

Thats what i've done, Please have a look

Regards

SampleOnCondition: 'Number or received messages' -> timeoutTextField is enabled
image
If timeout is set to 0 the Sub Sampler behaves like ever before and waits for all messages to arrive (never times out)

SampleOnCondition: 'specified elapsed time (ms)' -> timeoutTextField is disabled
image

@Jadeite09 Jadeite09 requested a review from chongyuanyin July 1, 2022 06:57
ChangingFond and others added 11 commits July 4, 2022 09:00
* Added .idea/ folder to gitignore
* Fixed various typos, including in the README
* Implemented fix for buggy decoding exception, updated decoding standard in
general
* Merged a semi-functional, configurable solution for waiting for a limited
amount of sampler response messages with timeout
* Added factual corrections to README
* Fixed various typos throughout README
* Renamed main project package to reflect that this is not a product made by
XMeter
* Removed download folder to avoid binaries in working tree, possible confusion
and due to redundancy
* Reverted package name to 'net.xmeter'
@br41nst0rm br41nst0rm changed the title MQTT Sub Sampler: Sample on 'Number or received messages' is missing timeout option MQTT Sub Sampler: Timeout Option for Sample on 'Number or received messages' Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants