2 messages for check coming too quickly

Hi,

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”)
.check(
wsAwait.within(60 seconds).until(1)
.regex()
)
).additionalActions()
)
}

during(Configuration.stdScenarioExecTime minutes)
{
exec(expectEventWithNextRequestCounter())
}

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.
https://github.com/gatling/gatling/blob/master/gatling-http/src/test/scala/io/gatling/http/Ws2CompileTest.scala#L67-L68