|
|
|
@ -1929,9 +1929,10 @@ will typically notice the broker is not responding within 10 seconds. Clients ne |
|
|
|
implement their own reconnect logic. |
|
|
|
implement their own reconnect logic. |
|
|
|
==== |
|
|
|
==== |
|
|
|
|
|
|
|
|
|
|
|
Furthermore, an application can directly intercept every incoming and outgoing message by |
|
|
|
The above events reflect points in the lifecycle of a STOMP connection. They're not meant |
|
|
|
registering a `ChannelInterceptor` on the respective message channel. For example |
|
|
|
to provide notification for every message sent from the client. Instead an application |
|
|
|
to intercept inbound messages: |
|
|
|
can register a `ChannelInterceptor` to intercept every incoming and outgoing STOMP message. |
|
|
|
|
|
|
|
For example to intercept inbound messages: |
|
|
|
|
|
|
|
|
|
|
|
[source,java,indent=0] |
|
|
|
[source,java,indent=0] |
|
|
|
[subs="verbatim,quotes"] |
|
|
|
[subs="verbatim,quotes"] |
|
|
|
@ -1947,8 +1948,7 @@ to intercept inbound messages: |
|
|
|
} |
|
|
|
} |
|
|
|
---- |
|
|
|
---- |
|
|
|
|
|
|
|
|
|
|
|
A custom `ChannelInterceptor` can extend the empty method base class |
|
|
|
A custom `ChannelInterceptor` can use `StompHeaderAccessor` or `SimpMessageHeaderAccessor` |
|
|
|
`ChannelInterceptorAdapter` and use `StompHeaderAccessor` or `SimpMessageHeaderAccessor` |
|
|
|
|
|
|
|
to access information about the message. |
|
|
|
to access information about the message. |
|
|
|
|
|
|
|
|
|
|
|
[source,java,indent=0] |
|
|
|
[source,java,indent=0] |
|
|
|
@ -1966,6 +1966,12 @@ to access information about the message. |
|
|
|
} |
|
|
|
} |
|
|
|
---- |
|
|
|
---- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Note that just like with the `SesionDisconnectEvent` above, a DISCONNECT message |
|
|
|
|
|
|
|
may have been sent from the client, or it may also be automatically generated when |
|
|
|
|
|
|
|
the WebSocket session is closed. In some cases an interceptor may intercept this |
|
|
|
|
|
|
|
message more than once per session. Components should be idempotent with regard to |
|
|
|
|
|
|
|
multiple disconnect events. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[[websocket-stomp-client]] |
|
|
|
[[websocket-stomp-client]] |
|
|
|
|