HiveMQ

To simulate Sparkplug B messages in HiveMQ Swarm

Dear HiveMQ Support Team,

Good day.

Kindly help us to simulate the Sparkplug B messages inside Swarm using the trial license with 25 clients connection. We tried to run the Scenairo xml file as provided from the Installation folder, however, there is no outcome and we don’t see any messages coming into the HiveMQ control center. Appreciate if can share us some of the Scenario xml file sample for publishing Sparkplug B messages together with the description for us to understand.

Appreciated it so much on the assistance.

Thank you,
Hafiz

Hi Hafiz,

Welcome to our community!

Please share the scenario.xml that you are referring to, details or your HiveMQ broker deployment and output of the swarm command that you are running.

We are happy to look into your question, please try to describe your use case, what are you trying to achieve, as clear as possible.

Thank you,
Dasha from HiveMQ Team

Dear Dasha,

Good day.

Thanks for reaching us.

You may find our Scenario xml file as attached. We expected to see the SparkplugB messages produced at the broker. However, after we attempted to run the command for HiveMQ Swarm and Scenario file, seems like there is nothing appeared. Appreciate if can assist us further to provide a sample Scenario file for producing Sparkplug B messages.

(Attachment scenario.xml is missing)

Dear Dasha,

As in my previous email, the attachment cannot go through, kindly find the new attachment here of the Scenario file.

(Attachment Scenario File.zip is missing)

<scenario xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:noNamespaceSchemaLocation="scenario.xsd">
    <brokers>
        <broker id="b1">
            <address>localhost</address>
            <port>1883</port>
        </broker>
    </brokers>
    <clientGroups>
        <clientGroup id="cg1">
            <clientIdPattern>A[0-9]{4}</clientIdPattern>
            <count>10</count>
        </clientGroup>
    </clientGroups>
    <topicGroups>
        <topicGroup id="tg1">
            <topicNamePattern>topic/subtopic-[0-9]</topicNamePattern>
            <count>10</count>
        </topicGroup>
    </topicGroups>
    <stages>
        <stage id="s1">
            <lifeCycle id="s1.l1" clientGroup="cg1">
                <connect broker="b1"/>
            </lifeCycle>
        </stage>
        <stage id="s2">
            <lifeCycle id="s2.l1" clientGroup="cg1">
                <publish topicGroup="tg1" count="10"/>
            </lifeCycle>
        </stage>
        <stage id="s3">
            <lifeCycle id="s2.l1" clientGroup="cg1">
		<publish topicGroup="tg1" count="100" rate="10/1s" payloadGeneratorType="hello-world-generator"/>
            </lifeCycle>
        </stage>
        <stage id="s4">
            <lifeCycle id="s3.l1" clientGroup="cg1">
                <disconnect/>
            </lifeCycle>
        </stage>
    </stages>
</scenario>

Hi Muhammad Hafiz,

Thank you for sharing your scenario.xml. There is a mistake in the scenario:

Could not upload the scenario. Invalid Scenario: Could not validate scenario against scenario.xsd, reason: cvc-id.2: There are multiple occurrences of ID value 's2.l1'.

You should fix the lifeCycle id at the stage s3 and update the lifeCycle id="s2.l1" to lifeCycle id="s3.l1":

<stage id="s3">
            <lifeCycle id="s3.l1" clientGroup="cg1">

Kind regards,
Dasha from HiveMQ Team