I need to update timestamp value from Json file. And call API. But timestamp value is not updated when API is called.
val records = jsonFile("json-files/requests.json").records
val date = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss")
/**
* Triggers
*/
val triggerForPostRequests = feed(records.circular).exec(session => {
session("payload").session.set("timestamp", date.format(System.currentTimeMillis()))
session
}).exec(http("simulation").
post(session => session("uri").as[String].replace("{uuid}", randomUUID().toString))
.body(StringBody("${payload.jsonStringify()}".replace("${timestamp}", date.format(System.currentTimeMillis())))).check(status.is(200)))