Search code examples
jmeterrabbitmqjmeter-4.0

How can we Send Different messages to rabbitmq per thread using jmeter AMQP publisher plugin?


I am using jmeter to pump messages into RabbitmQ Queue.

I am sending 100 messages per second But I am able to send only same message 100 times.

I need to send different message per thread. Is it possible using Jmeter AMQP Publisher plugin?

For example I am using below JSON message:

{
    "data": [{
        "i_StationId": "1"
    }, {
        "dt_TimeStamp": "2019-06-10 23:59:02.000"
    }, {
        "s_Period": "1560191342"
    }, {
        "i_SubStationId": "1"
    }, {
        "datatype": "cpcb_ind"
    }, {
        "codclean": "5.96"
    }, {
        "bodclean": "5.96"
    }, {
        "flowclean": "5.96"
    }, {
        "tssmeasured": "5.96"
    }, {
        "phmeasured": "5.96"
    }, {
        "i_CustomerId": "1"
    }],
    "date_time": "2019-06-10 23:59:02.000",
    "station_id": 1
}

Now in the next message i want to send another JSON message instead of same message like below.

{
    "data": [{
        "i_StationId": "2"
    }, {
        "dt_TimeStamp": "2019-06-10 23:59:02.000"
    }, {
        "s_Period": "1560191342"
    }, {
        "i_SubStationId": "2"
    }, {
        "datatype": "cpcb_ind"
    }, {
        "codclean": "5.96"
    }, {
        "bodclean": "5.96"
    }, {
        "flowclean": "5.96"
    }, {
        "phclean": "5.96"
    }, {
        "tssclean": "5.96"
    }, {
        "i_CustomerId": "1"
    }],
    "date_time": "2019-06-10 23:59:02.000",
    "station_id": 2
}

So i want to send 100 different messages at a time using AMQP Publisher. Please tell me how it is possible?

Please find the attached image of how i am trying


Solution

  • Please check if the jmeter functions are supported with this sampler. There are various function like thread, threadgroup, random etc. If these are supported then you need to use the function to generate different data everytime like:-

    i_SubStationId": "${__Random(0,10)}"
    

    Ref:-https://jmeter.apache.org/usermanual/functions.html

    1. Check if CSV Data set config is supported. Then, you can pass the data from csv. But, I am not sure if this is supported or not.

    enter image description here

    Hope this helps.