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

Unable to load topic on each iteration from csv file #22

Closed
hitkik opened this issue Sep 28, 2017 · 9 comments
Closed

Unable to load topic on each iteration from csv file #22

hitkik opened this issue Sep 28, 2017 · 9 comments

Comments

@hitkik
Copy link

hitkik commented Sep 28, 2017

Hi,

I have created a script using MQTT plug in which sends messages to a topic.
I have parameterized payload and passing message from csv file.
Jmeter is able to load new message from csv file on each iteration and publish to the topic which is hard coded.
But when I try to parameterise Topic name and pass it from csv file, topic name is loaded only once when thread is actually started and is unable to update topic name on each iteration which is my requirement.

@jinfahua
Copy link
Member

Pub sampler could be parameterized, but sub sampler cannot be parameterized - one sub sampler can only sub to one topic. If you'd like to have one user sub to different topics, now you will have to create several sub samplers.

@hitkik
Copy link
Author

hitkik commented Sep 28, 2017

Thanks for reply.
I have already parameterized pub topic but the problem is topic not getting updated on each iteration. It loads value from csv only once and uses the same value throughout the test execution. I want pub topic to get updated on each iteration

@jinfahua
Copy link
Member

I created a temp fix, please try following attachment. If it works for you, we'll include in the future release.

mqtt-xmeter-jar-with-dependencies.jar.zip

@jinfahua jinfahua reopened this Sep 28, 2017
@hitkik
Copy link
Author

hitkik commented Sep 28, 2017

It is working now.
Thanks.

@hitkik hitkik closed this as completed Sep 28, 2017
@hitkik hitkik reopened this Jan 8, 2018
@hitkik
Copy link
Author

hitkik commented Jan 8, 2018

Hi,
The problem is same as mentioned in the conversation above but this time it is with clientid. MQTT pub and sub sampler reads cliendId from a csv file only during 1st cycle (iteration) and then keeps same value for all following iterations during thread execution.
image

My requirement is, the value of ${clientid} (in above picture) should be updated on all successive iterations. i.e. sampler should read new value from a file for every iteration.

Can you fix this problem?

P.S: I am re-opening same issue (#22) as the problem is quite similar to the issue #22 :)

@hitkik
Copy link
Author

hitkik commented Jan 9, 2018

otherwise it would be good idea and easier if you can add clear connection feature in the plugin

@rende2005
Copy link
Contributor

@Hiteshkikani ClientId (as part of MQTT context) is determined during the connection phase, thus across the iterations within a JMeter thread, ClientId will not change.

We have a new implementation(in "separate_conn" branch ) to create MQTT connection before publish/subscribe sampler, so it's promising you can clear the connection at the end of your iteration, and create a new one with another ClientId for the next loop.

I will keep you posted after some verification test.

@rende2005
Copy link
Contributor

rende2005 commented Feb 22, 2018

@Hiteshkikani
You can get the new plugin binary from https://github.com/emqtt/mqtt-jmeter/releases/tag/v1.0.1
Please refer to README instructions @ https://github.com/emqtt/mqtt-jmeter/tree/separate_conn when you try it out.

Please let us know if this helps.

@hitkik
Copy link
Author

hitkik commented Feb 22, 2018

@rende2005 thank you so much. This served my purpose. Appreciate your support

@hitkik hitkik closed this as completed Feb 22, 2018
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

No branches or pull requests

3 participants