# Subscribe checks for multiple messages real-time WebSocket

**URL:** <https://community.gatling.io/t/subscribe-checks-for-multiple-messages-real-time-websocket/8400>\
**Category:** Gatling (Open-Source)\
**Created:** [October 26, 2023, 4:25pm UTC](https://community.gatling.io/t/subscribe-checks-for-multiple-messages-real-time-websocket/8400 "2023-10-26T16:25:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mandreev](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/mandreev/32/1352_2.png) [@mandreev](https://community.gatling.io/u/mandreev)\
**Post date:** [October 26, 2023, 4:25pm UTC](https://community.gatling.io/t/subscribe-checks-for-multiple-messages-real-time-websocket/8400/1 "2023-10-26T16:25:54Z")

</div>

I’am using Galting and in the web socket stress test I use the subcribe method to test the correct read real -time notifications. For one request I expect response in multiple messages.

Does gatling dsl support this case? Do you have any plans to support “one request - multiple responses” case?

I found similar question in SO ([GATLING - Subscribe checks for multiple messages real-time WebSocket - Stack Overflow](https://stackoverflow.com/questions/63908456/gatling-subscribe-checks-for-multiple-messages-real-time-websocket)) without response.

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [October 26, 2023, 4:32pm UTC](https://community.gatling.io/t/subscribe-checks-for-multiple-messages-real-time-websocket/8400/2 "2023-10-26T16:32:36Z")

</div>

Have you first checked the documentation? [Gatling - WebSocket](https://gatling.io/docs/gatling/reference/current/http/websocket/#set-a-check)

---

<div class="post-metadata">

**Author:** ![mandreev](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/mandreev/32/1352_2.png) [@mandreev](https://community.gatling.io/u/mandreev)\
**Post date:** [October 26, 2023, 4:43pm UTC](https://community.gatling.io/t/subscribe-checks-for-multiple-messages-real-time-websocket/8400/3 "2023-10-26T16:43:27Z")

</div>

Thanks for you support.

But as I can see we can check only expected count of messages and can not process unlimited (unknown count) of messages. So I can not check every message during simulation.  
This case is not covered with gatling documentation.

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [October 26, 2023, 4:50pm UTC](https://community.gatling.io/t/subscribe-checks-for-multiple-messages-real-time-websocket/8400/4 "2023-10-26T16:50:33Z")

</div>

OK, so you’re expecting an undefined number of messages. This information was missing from your original question.  
How do you detect that you’ve received the last message? Can’t you use the matching filter for this?

---

<div class="post-metadata">

**Author:** ![mandreev](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/mandreev/32/1352_2.png) [@mandreev](https://community.gatling.io/u/mandreev)\
**Post date:** [October 26, 2023, 9:41pm UTC](https://community.gatling.io/t/subscribe-checks-for-multiple-messages-real-time-websocket/8400/5 "2023-10-26T21:41:36Z")

</div>

I would like to receive all messages from server during simulation. For each message I would like to verify a computable condition like delay of event is less than X.

From documentation and api sources I can not understand how to implement an unbounded loop of processing incoming messages.

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/gatling2/original/2X/b/b148e0742de35c6280726cabf3ecd3de2d320f63.png) [@system](https://community.gatling.io/u/system)\
**Post date:** [November 25, 2023, 9:42pm UTC](https://community.gatling.io/t/subscribe-checks-for-multiple-messages-real-time-websocket/8400/6 "2023-11-25T21:42:05Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
