krylovsk / mqtt-benchmark

MQTT broker benchmarking tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for placeholders in topic

licensedslacker opened this issue · comments

It would be handy to have placeholders in the topic field.
For example "/topic/%i" become "/topic/1" when connected by a client with ID 1.

Client ID would be one field. A random unique number would be also nice.

Will #6 work for your use case?

@licensedslacker can you describe the suggestion with topic placeholders in more detail?

How about just letting each client sending to their own topic (what you suggest as example)?
From what I see providing a template or a number of topics (suggestion of @edoardesd in #6) requires sharding of messages into different topics with a fair and deterministic algorithm to get unbiased aggregated results.

If brokers treat topics with different number of writers or messages in the queue differently it may skew the measurements.

I think case #6 does not directly satisfy my request. My intention was to add a unique client ID to the topic, not just a random number. The use case what I had in my mind was many-to-one topology where multiple clients produce messages to one receiver and the sender information is encoded into the topic.

Sorry for the late reply.

Even if there are some similarities, my proposal is slightly different from the one of @licensedslacker .
In #6, I want to give the possibility to the user to have N clients and M different topics. The simplest way to do it is adding a random number between 0 and M to the topic level. Of course is a trivial solution that not ensure at all to have M different topics, but it's a first step.

This allows a user to test the impact of the number of different topics to the broker. Think about having 100 fixed clients and you want to see what happen when there are 10, 20, 50 or 100 possible topics.

A special case, is when N == M (clients == different topics you want to use). Here we are in the case proposed by @licensedslacker , because we can reuse the topic fashion he explained in the first post.
It might be possible to reuse his topic fashion even when N != M. For example: 10 clients and 2 topics will became topic/1 for the first 5 clients and topic/2 for the remain clients.