2 messages for check coming too quickly


I’m working with huge amount of messages (about 6k per second). From time to time by network reasons I’m receiving 2 messages in websocket at exactly same time (up to millisecond). Because of Receiving/Sending queues.
In my scenario I need to be sure that I have received all messages one by one in a sequence. So code looks pretty simple for such check:

def expectEventWithNextRequestCounter(): ChainBuilder =
return exitBlockOnFail(exec(
ws(“Sequence check”)
wsAwait.within(60 seconds).until(1)

during(Configuration.stdScenarioExecTime minutes)

And I came to problem: I’m catching 2 messages at same timing. First one was caught by check and analyzed. But second one was skipped because I’m setting next check not right after first one but with small delay regarding to AdditionalActions() method and iteration through during() loop.
Is there a way to work exactly through every messages in websocket?

WebSocket support is being revamped for Gatling 3. It supports multiple sequential checks.