Legacy Dev Forum Posts

 View Only

Sign Up

Web Messaging SDK - Java - WebSocket Error after 5mins of being idle

  • 1.  Web Messaging SDK - Java - WebSocket Error after 5mins of being idle

    Posted 06-05-2025 18:35

    anon76286413 | 2022-02-23 16:20:26 UTC | #1

    This is actually an ask from a client.

    Hi Team,

    While exploring the Java SDK and playing around with it, I found the following:

    After about 5 mins, the websocket goes into an ERROR state if no messages are exchanged. If I am sending a ping every 4:30 minutes, the connection seems to survive. My guess is that upon 5 minutes of being idle, the websocket transitions into an ERROR state and then refuses to send communications anymore.

    The websocket instance is private inside WebMessagingClient and hence we have no way of identifying the state of websocket before sending messages from our code. Also, exploring the sdk code I see that currently Genesys sdk is not handling / attaching onError listner to the underlying websocket implementation. This causes the webmessaging client to miss out on this state transition.

    My ask is to the genesys dev team, if this can be handled by subscribing to onError and automatically update / reconnect websocket with the sdk? Otherwise, if the onError can be exported into sessionListener interface then we can subscribe and try to handle with a re-issue of connect.


    Angelo_Cicchitto | 2022-02-24 12:37:37 UTC | #2

    Hi - we are looking into this, for potential area of improvement. Thanks!


    Laurent_Rustuel | 2022-03-25 09:21:39 UTC | #3

    Hello, a new version of the sdk is available, with some improvment for this. Added two method to check the state of the weboscket ( isOutputClosed and isInputClosed). Implemented onError that will trigger all listeners Available since version 7.1.x Feedback welcomed


    system | 2022-04-24 09:22:22 UTC | #4

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


    This post was migrated from the old Developer Forum.

    ref: 13680