This seems really simple and I have validated that the requests are never sent via Wireshark.
This DOES NOT send an HTTP request
.exec(
session -> {
try {
http("Send [STORE]_CURRENT_STATE")
.post("http://localhost:11640/messages")
.headers(dashboardEventHeaders)
.header("MESSAGE_TYPE", "#{storeId}_STORE_UPDATED")
.body(StringBody(buildStoreUpdatedEvent()))
.check(regex("Sent"))
;
} catch (Exception e) {
e.printStackTrace();
}
return session;
}
)
.pause(TEN_SECONDS)
.injectOpen(atOnceUsers(1))
No Exception is printed
This DOES (Identical except I have commented out the session)
.exec(
// .session -> {
// try {
http("Send [STORE]_CURRENT_STATE")
.post("http://localhost:11640/messages")
.headers(dashboardEventHeaders)
.header("MESSAGE_TYPE", "#{storeId}_STORE_UPDATED")
.body(StringBody(buildStoreUpdatedEvent()))
.check(regex("Sent"))
// ;
// } catch (Exception e) {
// e.printStackTrace();
// }
// return session;
// }
)
.pause(TEN_SECONDS)
.injectOpen(atOnceUsers(1))