This change ensures that StompSubProtocolHandler is injected with an
ApplicationEventPublisher for both the Java and XML config.
Backport for:
0dddb6f3e14372dac002
Issue: SPR-11825
Prior to this commit, the ServletResponseHttpHeaders.get method
would throw an NPE when used under Wildfly 8.0.0.Final and 8.1.0.Final.
This can be traced to WFLY-3474, which throws an NPE when calling
HttpServletResponse.getHeaders("foo") and that header has not
been defined prior to that.
This would cause NPE being thrown by AbstractSockJsService when
checking for CORS HTTP headers in the server HTTP response.
This commit surrounds that method call in AbstractSockJsService and
guards against this issue.
Issue: SPR-11919
(cherry picked from commit 24cdefb)
Prior to this commit, calls to getAllow would fail is setAllow was set
to an EmptyCollection right before.
java.lang.IllegalArgumentException: No enum constant
org.springframework.http.HttpMethod
This commit fixes this by testing the header value for an empty value
before trying to use it to get a value from the Enum.
Issue: SPR-11917
(cherry picked from commit 9919a98)
This change ensures the state of a SockJS session is set to CLOSED
immediately after close is invoked. This avoids duplicate invocations
of afterConnectionClosed in WebSocket transport.
This is a backport of:
3af488a701
Issue: SPR-11884
Sessions connected to a STOMP endpoint are expected to receive some
client messages. Having received none after successfully connecting
could be an indication of proxy or network issue. This change adds
periodic checks to see if we have not received any messages on a
session which is an indication the session isn't going anywhere
most likely due to a proxy issue (or unreliable network) and close
those sessions.
This is a backport for commit:
a3fa9c9797
Issue: SPR-11884
This change introduces removeOnCancelPolicy on ThreadPoolTaskScheduler
and ScheduledExecutorFactoryBean and sets it to true for SockJS.
This ensures that cancelled tasks are removed immediately to avoid
the "unbounded retention of cancelled tasks" that is mentioned in
the Javadoc ScheduledThreadPoolExecutor:
"By default, such a cancelled task is not automatically removed from
the work queue until its delay elapses. While this enables further
inspection and monitoring, it may also cause unbounded retention of
cancelled tasks. To avoid this, set setRemoveOnCancelPolicy to true,
which causes tasks to be immediately removed from the work queue at
time of cancellation."
This is a backport for:
7441f23012
Issue: SPR-11918