What is the correct way to handle WebSocket disconnects during high-throughput messaging load tests?

How do I correctly to handle WebSocket disconnects during high-throughput messaging load tests? I am running a JMeter script to simulate 5,000 concurrent digital messaging sessions using the Genesys Cloud Digital API. The environment is Genesys Cloud EU-West. When the concurrent session count exceeds 1,200, the WebSocket connections start dropping with a 1006 Abnormal Closure code. The JMeter log shows the connection is closed by the server without a prior close frame from the client side. I am using the standard WebSocket sampler in JMeter version 5.6.2. The test plan creates a new WebSocket connection for each virtual user, authenticates via OAuth 2.0, and then sends a text message every 30 seconds. The error happens randomly, not at a specific threshold, which makes it hard to pinpoint. I have checked the API rate limits for the messaging endpoint, and the requests per second are well within the documented limits. The issue seems to be related to the WebSocket connection stability rather than HTTP rate limiting. I noticed that when I reduce the concurrent users to 500, the test runs smoothly for hours without any drops. I am wondering if there is a specific header or keep-alive setting I need to configure in JMeter to maintain the WebSocket connection under heavy load. Also, is there a known limit on the number of concurrent WebSocket connections per organization in Genesys Cloud for digital messaging? The documentation mentions limits for voice calls, but I couldn’t find specific numbers for messaging sessions. I have tried increasing the connection timeout and the response timeout in JMeter, but it did not help. The error persists. I am also seeing some 400 Bad Request errors for the initial handshake when the load is high, which suggests the server might be rejecting new connections. Can anyone share their JMeter configuration for testing digital messaging at scale? I am particularly interested in how you handle reconnection logic and session management. Any advice on optimizing the test plan for better stability would be appreciated. I am using the latest version of the Genesys Cloud REST API. The issue is consistent across multiple test runs. I have also checked the server logs, but they do not provide much detail on why the connections are being closed. I am assuming it might be a resource constraint on the server side, but I am not sure. Please let me know if you have encountered similar issues.