Sending messages to Kafka

val scn = scenario(“Legacy Recieving Streaming”)
.exec(kafka(“request”).send[String](_=>" + encodeBase64((receivingHeaderBufferjai + ""checksum": “****” +
.replace(\r, “”).replace(\n, “”)) + ""body": “****”+encodeBase64(compress(receivingMsgBufferjai

.replace("${storeNum1}",“1”+r.nextInt(9999).toString))).replace(\r, “”).replace(\n, “”)+"}]}")
.getBytes()).replace(\r, “”).replace(\n, “”) + "))

Hi In the above I am trying to replace storenum dynamically, however I am not able to…Could someone help me on this


EL ( works in Gatling DSL but not in your own functions.

Retrieve the value you need using the following, then use that val in your function.

val myStoreNum=session(“storeNum”).as[String]

Hope this helps,