We are having the below code snippet with one of it’s API call:
// Token generation
val scnT1 = scenario("Token Generation Fulfillment")
.exec(http("Get Token")
.post("https://login.microsoftonline.com/(valid subscription key)/oauth2/token")
.header("Content-Type", "application/x-www-form-urlencoded")
.formParam("client_id", service_id)
.formParam("client_secret", service_secret)
.formParam("grant_type", "client_credentials")
.formParam("resource", "***") // valid resource id
.check(jsonPath("$.access_token").saveAs("authToken4"))
).exitHereIfFailed
.exec{session => { authToken = session("authToken4").as[String]
println(s"Token generated for fulfillment")
session
}
}
// API call
object invokeFulfillmentCalls {
var apiheaders = Map("X-Boomi-Debug" ->"false","Content-Type" -> "application/json","Authorization" -> "Bearer ${authToken}","Ocp-Apim-Subscription-Key" -> "***")
var apimethod = exec(session => session.set("authToken",authToken4)).feed(msorderid)
// get calls
.exec(http("PickReport")
.get("https://svt2apigw.cmltd.net.au/col/ocado/fulfillment/v1/pickreport/SVT-FID-PR-20-${msorderid}")
.headers(apiheaders)
.check(status is 200)
)
}
Whenever our environment is hitting the APIM URL (Either for MRL or Boomi) from Gatling Script, which is running inside ArgoCD, we are getting j.n.c.ClosedChannelException for 100% requests. We are able to hit the same URL from postman installed on Local VPC.
For the below URL the same thing is working which is generating the token and pushing the events to the Event hub:
object inject_DR_EH_500 {
var apiheaders = Map("Content-Type" -> "application/atom+xml;type=entry;charset=utf-8","Authorization" -> "Bearer ${authTokenMs}")
var apimethod = exec(session => session.set("authTokenMs",authTokenMs)).feed(msorderid).feed(timestampFeeder)
.exec(http("Delivery Report FSMev EH 500 Items")
.post("https://EVH-OTF-***-***-AUE.***.windows.net/***/messages") // pushing events to event hub
.headers(apiheaders)
.body(ElFileBody("src/***/resources/data/***.json")).asJson
.check(status is 201)
)
}
We have been in contact with our DevOps team, and they have tested CURL operations in the Argo CD Gatling PODs, which are functioning properly. They informed us that there is no issue on the server side, so we need to inspect our script. This error appears to be new to us, as the code was working previously but suddenly started throwing a Closed Channel exception.