Minor update to STOMP chapter

Issue: SPR-16681
This commit is contained in:
Rossen Stoyanchev 2018-05-23 21:49:25 -04:00
parent fbf25c536d
commit ed439eefcf
1 changed files with 11 additions and 5 deletions

View File

@ -1929,9 +1929,10 @@ will typically notice the broker is not responding within 10 seconds. Clients ne
implement their own reconnect logic.
====
Furthermore, an application can directly intercept every incoming and outgoing message by
registering a `ChannelInterceptor` on the respective message channel. For example
to intercept inbound messages:
The above events reflect points in the lifecycle of a STOMP connection. They're not meant
to provide notification for every message sent from the client. Instead an application
can register a `ChannelInterceptor` to intercept every incoming and outgoing STOMP message.
For example to intercept inbound messages:
[source,java,indent=0]
[subs="verbatim,quotes"]
@ -1947,8 +1948,7 @@ to intercept inbound messages:
}
----
A custom `ChannelInterceptor` can extend the empty method base class
`ChannelInterceptorAdapter` and use `StompHeaderAccessor` or `SimpMessageHeaderAccessor`
A custom `ChannelInterceptor` can use `StompHeaderAccessor` or `SimpMessageHeaderAccessor`
to access information about the message.
[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]]