We're running Gatling/Scala to load test an application in the following manner:
The Gatling setup looks like this:
setUp(
JmsScenario.run inject(atOnceUsers(events)) protocols(JmsScenario.jmsConnect),
HttpScenario.run inject(constantUsersPerSec(httpThroughput) during(httpDuration)) protocols(HttpScenario.protocol),
)
But instead of using during(...)
I'd like to use something like untilAmqMessageQueueIsEmpty()
. Is there some (fairly easy) way to accomplish this?
Use asLongAs
and call some custom code (in Java if you don't know Scala). https://docs.gatling.io/reference/script/core/scenario/#aslongas.
// isAmqMessageQueueIsEmpty is something only you can code
// It has to return a Boolean
asLongAs(session => isAmqMessageQueueIsEmpty()) {
???
}