rabbitmq-perf-test icon indicating copy to clipboard operation
rabbitmq-perf-test copied to clipboard

Create message payload from template files

Open acogoluegnes opened this issue 4 years ago • 4 comments

From the mailing list.

Payload for published messages could be based on one or several template files that would contain placeholders to make the content dynamic, e.g.:

{
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9",
    "payload": {
        "trxid": "DEPOSIT-PUBSUB-${uuid}",
        "trx_amount": ${list('5000','10000','50000')},
        "trx_notes": "${list('Deposit','Expense')}"
    }
}

Other candidate "functions" in placeholder could be sequence, random (not an UUID, just a random, 10-character long string).

Functions could accept arguments, e.g. ${random(length:16, cache:50)}.

acogoluegnes avatar Nov 07 '19 12:11 acogoluegnes

any timeline on this one? For me would be the sequence function important

typekpb avatar Apr 17 '20 12:04 typekpb

@typekpb this is open source software so you are welcome to contribute it.

michaelklishin avatar Apr 17 '20 13:04 michaelklishin

@acogoluegnes is there a library that handles such template functions or we'd have to effectively develop a tiny templating language ourselves? In the latter case this probably shouldn't be labeled with effort-low :)

michaelklishin avatar Apr 17 '20 13:04 michaelklishin

@michaelklishin Fair enough, this will require a custom development, adding effort-medium :-)

acogoluegnes avatar Apr 20 '20 09:04 acogoluegnes