Sending messages to Kafka

val scn = scenario(“Legacy Recieving Streaming”)
.exec(kafka(“request”).send[String](_=>" + encodeBase64((receivingHeaderBufferjai + ""checksum": “****” +
MD53(encodeBase64(compress(receivingMsgBufferjai.replace("${storeNum1}",“1”+r.nextInt(999999).toString)))
.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

Hi,

EL (http://gatling.io/docs/2.2/session/expression_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,
Barry