How to load the body part every time in load testing

exec(
http(session => “Post Provider ECMM”)
.post(apiLink + “providers”)
.header(“Content-Type”, “multipart/mixed”)
.header(“client_id”, “”)
.header(“Authorization”, “”)
.header(“correlation_id”, “”)
.header(“actor”, “”)
.header(“scope”, “”)

.bodyPart(ByteArrayBodyPart(readPayLoad())
.contentType(“application/vnd.uhc.provider-ecmm.xml”).contentId(“apimessage”)
)

From the simulation i was calling one java method “readPayload()” to get the payload data dynamically but problem was this method was calling once at the time of simulation start up. i was not able to pass different data for multiple users…

can you please help me out on this

If you want to dynamically modify body in your request, then you should look at ELFileBody.

http://gatling.io/docs/2.1.7/http/http_request.html?highlight=elfilebody#request-body