Lifecycle events
As shown previously, the @OnMessage
lifecycle method is used to handle the primary communication event, which is the delivery of a new message. Other lifecycle events are often used to handle other events of interest. The following table shows the four lifecycle events that are triggered by the WebSockets endpoint:
Annotation | Event | Example |
| Connection opened |
|
| Connection closed |
|
| Message arrived |
|
| Connection error |
|