Commit Graph

575 Commits

Author SHA1 Message Date
Rossen Stoyanchev dc5b5ca8ee Check the user of a SockJS request
Issue: SPR-12497
2014-12-02 12:13:35 -05:00
Juergen Hoeller e6d7af4ea8 Polishing 2014-11-28 17:36:58 +01:00
Juergen Hoeller 0caeffcd54 Polishing
(cherry picked from commit 7e07f3d)
2014-11-27 18:57:57 +01:00
Brian Clozel bb150c47cf Add undertow 1.1.0.Final support
Upgrade undertow dependency to 1.1.0.Final.
Add support for undertow 1.1.0.Final in the
UndertowRequestUpgradeStrategy, after a breaking change in the
`io.undertow.websockets.jsr.ConfiguredServerEndpoint` constructor.

Issue: SPR-12302
2014-11-24 14:22:10 +01:00
Juergen Hoeller 05bdc2cf77 Consistent declaration and use of UTF-8 Charset constants, plus related polishing 2014-11-11 02:38:30 +01:00
Juergen Hoeller 9ff8a01f29 Polishing 2014-11-07 17:14:50 +01:00
Brian Clozel 1fff631daa Fix SubProtocolHandler duplicate registration
Prior to this change, duplicate SubProtocolHandlers could be registered
when configuring STOMP with several registrations:

    public void registerStompEndpoints
          (final StompEndpointRegistry registry) {
      this.endpointRegistry.addEndpoint("/stompOverWebSocket");
      this.endpointRegistry.addEndpoint("/stompOverSockJS").withSockJS();
    }

This commit registers sub-protocols in a Set instead of a list (see
SubProtocolWebSocketHandler), thus fixing the issue.

Issue: SPR-12403
2014-11-03 14:25:27 +01:00
Sam Brannen 14f4d34fdb Clean up warnings in spring-websocket 2014-11-01 16:11:57 +01:00
Juergen Hoeller 1146d5ba1d Polishing 2014-10-29 22:44:59 +01:00
Rossen Stoyanchev 38ef6dec50 Fix test issue with Set iteration order 2014-10-29 17:23:04 -04:00
Rossen Stoyanchev 8f21c85511 Explicitly close Spring context in WS integration test 2014-10-28 22:10:49 -04:00
Rossen Stoyanchev 8c727be4e1 Close Spring context in SockJS integration test setup 2014-10-28 17:51:15 -04:00
Rossen Stoyanchev 70e6e3bb39 Fix condition check in SockJsClient lifecycle method 2014-10-28 17:51:15 -04:00
Rossen Stoyanchev da612d079f Replace "if(" with "if (" 2014-10-27 09:04:23 -04:00
Sebastien Deleuze 6592784ef4 Fix a package tangle between SockJS support and transport packages
Issue: SPR-12379
2014-10-27 13:28:01 +01:00
Sebastien Deleuze 58f4014b17 Add an option to disable automatic addition of CORS header
Issues: SPR-12283
2014-10-26 21:20:53 +01:00
Sebastien Deleuze 743356fa21 Add an option to set an Origin whitelist for Websocket and SockJS
This commit introduces a new OriginHandshakeInterceptor. It filters
Origin header value against a list of allowed origins.

AbstractSockJsService as been modified to:
 - Reject CORS requests with forbidden origins
 - Disable transport types that does not support CORS when an origin
   check is required
 - Use the Origin request header value instead of "*" for
   Access-Control-Allow-Origin response header value
   (mandatory when  Access-Control-Allow-Credentials=true)
 - Return CORS header only if the request contains an Origin header

It is possible to configure easily this behavior thanks to JavaConfig API
WebSocketHandlerRegistration#addAllowedOrigins(String...) and
StompWebSocketEndpointRegistration#addAllowedOrigins(String...).
It is also possible to configure it using the websocket XML namespace.

Please notice that this commit does not change the default behavior:
cross origin requests are still enabled by default.

Issues: SPR-12226
2014-10-26 21:18:04 +01:00
Rossen Stoyanchev 01aa64c534 Simple broker sends notice after disconnect
Before this change the simple broker simply removed subscriptions
upon receiving a DISCONNECT message assuming it was a result of
a client STOMP WebSocket session ending.

However, if the server-side application sends a DISCONNECT to
the broker in order to terminate a session, the STOMP WebSocket
session could remain unware without any further action. This
change ensures the simple broker sends a DISCONNECT_ACK message
downstream whenever it receives a DISCONNECT.

Issue: SPR-12288
2014-10-24 09:48:18 -04:00
Rossen Stoyanchev 687955a704 Add ImmutableMessageChannelInterceptor
This change adds a ChannelInterceptor that flips the immutable flag on
messages being sent. This allows components sending messages to leave
the message mutable for interceptors to further apply modifications
before the message is sent (and exposed to concurrency).

The interceptor is automatically added with the STOMP/WebSocket Java
and XML config and the StompSubProtocolHandler leaves parsed incoming
messages mutable so they can be further modified before being sent.

Issue: SPR-12321
2014-10-23 15:25:51 -04:00
Juergen Hoeller 3106905877 Polishing 2014-10-22 01:19:14 +02:00
Juergen Hoeller 8325b10080 Consistent formatting of license headers, package javadocs, and import declarations 2014-10-21 01:44:07 +02:00
Juergen Hoeller b6fdcffc94 HttpSessionHandshakeInterceptor and related web.socket.server polishing
Issue: SPR-12352
2014-10-20 23:32:46 +02:00
Juergen Hoeller 77a62ec8b8 Polishing 2014-10-20 17:42:18 +02:00
Juergen Hoeller 10328f1c22 Reimplemented ServerEndpointExporter to avoid BeanPostProcessor role
Issue: SPR-12340
2014-10-20 17:41:14 +02:00
Rossen Stoyanchev 3056301015 Improve HttpSessionHandshakeInterceptor
Use explicit flag whether to copy all attributes.
2014-10-14 09:29:06 -04:00
Sam Brannen 2f54b273a5 Delete unused imports in spring-websocket module 2014-10-13 20:37:08 +02:00
Rossen Stoyanchev 97596fb9f6 Allow plugging in a WebSocketHandlerDecorator
The WebSocketMessageBroker config now allows wrapping the
SubProtocolWebSocketHandler to enable advanced use cases that may
require access to the underlying WebSocketSession.

Issue: SPR-12314
2014-10-13 09:35:51 -04:00
Rossen Stoyanchev f0323be786 Add option to copy HTTP session id to handshake attrs
Issue: SPR-12314
2014-10-10 15:21:04 -04:00
Rossen Stoyanchev 4a29e164a8 Allow binary messages in StompSubProtocolHandler
Issue: SPR-12301
2014-10-10 14:31:39 -04:00
Brian Clozel 4cf19df462 SockJs client: add an XhrTransport for Undertow
This change adds a new XhrTransport for the SockJs client
implementation. This transport is based on `UndertowClient`,
Undertow's HTTP client.

Note that this transport can be customized with an OptionMap that is
used by the Xnio worker backing the I/O communications (see
http://xnio.jboss.org).

Implementation tested with undertow 1.0.36, 1.1.0.RC3, 1.2.0.Beta1.

Issue: SPR-12008
2014-10-08 16:52:40 +02:00
Brian Clozel 2a39081819 Add Vary:Origin HTTP header in SockJS responses
This change adds a "Vary: Origin" HTTP response header for /info and
/iframe SockJS endpoints.
This is preventing proxies and browsers from caching a response and
reusing it for an invalid Origin.

Reference: https://groups.google.com/forum/#!topic/sockjs/svsLWRorSis

Issue: SPR-12310
2014-10-08 16:37:50 +02:00
Juergen Hoeller e56559fd4d WebSocketSession extends java.io.Closeable, plus reorganization of AbstractSockJsSession's code
Issue: SPR-12311
2014-10-07 13:45:07 +02:00
Juergen Hoeller da14aeea7a TextMessage.toString() does not throw StringIndexOutOfBoundsException for payload with multibyte characters
Issue: SPR-12307
2014-10-07 13:35:38 +02:00
Juergen Hoeller 3a3c52dbdd Polishing 2014-10-01 01:10:25 +02:00
Juergen Hoeller 7f9baa3a09 Polishing 2014-09-26 22:38:41 +02:00
Brian Clozel a6e1c53f23 Update default SockJS CDN location
This commit updates the default location of the SockJS' client library.
The previous location is being retired by the project maintainers.

The new default location is backed by several CDN providers:
* https://cdn.jsdelivr.net/sockjs/0.3.4/sockjs.min.js

See sockjs/sockjs-client#198

Issue: SPR-12254
2014-09-26 21:42:08 +02:00
Rossen Stoyanchev 371d93b346 Detect unsent DISCONNECT messages
This change uses a ChannelInterceptor (inserted at index 0) to detect
when a DISCONNECT message is precluded from being sent on the
clientInboundChannel. This can happen if another interceptor allows
a runtime exception out from preSend or returns false.

It is crucial for such messages to be processed, so when detected
they're processed still.

Issue: SPR-12218
2014-09-25 23:22:12 -04:00
Juergen Hoeller 070642c148 Introduced addScope convenience method on CustomScopeConfigurer (for use in WebSocket configuration) 2014-09-25 01:31:33 +02:00
Juergen Hoeller 3836aa051f Message broker thread pools should be set up in allowCoreThreadTimeOut mode
Issue: SPR-12249
2014-09-25 01:29:00 +02:00
Rossen Stoyanchev b0e6091cad Lower "no session" message log level in SubProtocolWSH
Issue: SPR-12247
2014-09-24 15:04:57 -04:00
Rossen Stoyanchev 5b1cbf0306 Log WebSocket connection issues at DEBUG level
WebSocket clients going away is an expected and common occurance.
Logging at ERROR level on failure to close a connection or on failures
to write data to a WebSocket sessions has a high potential for false
positives with very little to do. This change lowers the log level for
a number of log messages that fit this category.

This should be helped by the effort already spent for 4.1 to ensure
logging at DEBUG level doesn't produce excessive amounts of logging.

Issue: SPR-12155
2014-09-24 10:07:15 -04:00
Rossen Stoyanchev 237b50a9c8 Allow configuring custom argument types
The WebSocket messaging namespace now exposes configuration options for
custom argument resolvers and return value handlers.

Issue: SPR-12217
2014-09-19 16:47:39 -04:00
Rossen Stoyanchev a99ef6d9b2 Extend websocket scope to event publication
This change extends the "websocket" scope to ApplicationContext events
published from StompSubProtocolHandler. This however will only work
with ApplicationEventMulticaster that multicasts events in the same
thread.

Issue: SPR-12172
2014-09-19 13:46:40 -04:00
Rossen Stoyanchev dc57cb2c9f Update SessionDisconnectEvent
SessionDisconnectEvent now extends AbstractSubProtocolEvent.

Issue: SPR-12156
2014-09-18 15:21:11 -04:00
Rossen Stoyanchev 4af9851585 Add user to DISCONNECT in StompSubProtocolHandler
Issue: SPR-12215
2014-09-18 15:06:08 -04:00
Rossen Stoyanchev 49b872e387 Adjust logging following SockJS client disconnect
Issue: SPR-11870
2014-09-04 00:23:10 -04:00
Juergen Hoeller 86b7118da8 Polishing 2014-09-04 02:30:25 +02:00
Juergen Hoeller 20c2ba35dc Polishing 2014-09-04 00:55:38 +02:00
Rossen Stoyanchev 2a0765e76d Allow setting SockJsMessageCodec in WebSocket config
Issue: SPR-12091
2014-08-25 15:19:50 -04:00
Juergen Hoeller b93dd95475 Polishing 2014-08-22 22:55:57 +02:00
Juergen Hoeller 86c5880888 Polishing 2014-08-21 18:41:23 +02:00
Juergen Hoeller 11805b6a5d ServerEndpointExporter can initialize itself based on a late-provided ServletContext as well (for Boot)
Also allows for direct setting of a ServerContainer and for custom triggering of endpoint registration.

Issue: SPR-12109
2014-08-21 18:40:35 +02:00
Juergen Hoeller 2ef3d66c89 Polishing 2014-08-18 19:27:08 +02:00
Phillip Webb ac8326d2df Polish mockito usage
Consistent use of BDDMockito rather than standard Mockito.
2014-08-11 16:23:11 -07:00
Sebastien Deleuze 3922f6fc53 Update references to RFC 2616
Replace references to the old RFC 2616 (HTTP 1.1) with references
to the new RFCs 7230 to 7235.

This commit also deprecates:
 - HttpStatus.USE_PROXY
 - HttpStatus.REQUEST_ENTITY_TOO_LARGE in favor of HttpStatus.PAYLOAD_TOO_LARGE
 - HttpStatus.REQUEST_URI_TOO_LONG in favor of HttpStatus.URI_TOO_LONG

Issue: SPR-12067
2014-08-07 14:50:45 +02:00
Stephane Nicoll 3da68cfe21 Remove unused imports 2014-08-04 14:13:40 +02:00
Rossen Stoyanchev 8751936b12 Fix issue with sub-protocol negotiation and SockJS
Before this change the SockJsWebSocketHandler precluded determination
of the sub-protocols by wrapping the actual target handler.

After this change SockJsWebSocketHandler implements SubProtocolCapable
and returns the list of sub-protocols from the wrapped handler.
2014-07-31 10:33:11 -04:00
Rossen Stoyanchev 41cdc92fc3 Remove AbstractWebSocketClient from SockJsClient
SockJsClient now implements WebSocketClient directly without extending
AbstractWebSocketClient.

Issue: SPR-12030
2014-07-30 15:39:01 -04:00
Rossen Stoyanchev c68b4c01e1 Polish SockJsClient 2014-07-30 15:29:46 -04:00
Rossen Stoyanchev ba952ca331 Fix test condition 2014-07-30 09:02:23 -04:00
Rossen Stoyanchev c89325b9ca Add WebLogicRequestUpgradeStrategy
This change creates an AbstractTyrusRequestUpgradeStrategy shared
between the WebLogic and GlassFish sub-classes.

The version of Tyrus is lowered to 1.3.5 to match the version used
in WebLogic (12.1.3) and that in turn requires a little extra effort
in the base AbstractTyrusRequestUpgradeStrategy to make up for
changes that have taken place from Tyrus 1.3.5 to 1.7.

Issue: SPR-11293
2014-07-25 17:16:00 -04:00
Rossen Stoyanchev 88d8dff3ac Upgrade to Tyrus 1.7
This change provides WebSocket support for the upcoming Glassfish 4.0.1
release while at the same dropping support for Glassfish 4.0 due to
incompatible changes.

Issue: SPR-11094
2014-07-24 09:58:22 -04:00
Rossen Stoyanchev afb56681ac Fix minor issue in StandardToWebSocketExtensionAdapter
This change ensures proper initialization of a WebSocketExtension
from a JSR-356 Extension.

This is in preparation for SPR-11094
2014-07-24 09:58:22 -04:00
Rossen Stoyanchev e74ac06733 Filter WebSocket extensions
Before this change the DefaultHandshakeHandler by default passed the
list of requested WebSocket extensions as-is relying on the WebSocket
engine to remove those not supported.

This change ensures that WebSocket extensions not supported by the
runtime are proactively removed instead.

This change is preparation for SPR-11094.
2014-07-24 09:58:22 -04:00
Rossen Stoyanchev 73267d7523 Ensure Undertow 1.1 compatibility
Issue: SPR-11914
2014-07-22 15:28:40 -04:00
Rossen Stoyanchev 988499f7dc Remove awaitCloseStatus in SockJS integration tests
A CloseStatus may not be received if the connection is closed while
the client is between XHR polling requests.
2014-07-22 13:40:02 -04:00
Juergen Hoeller 9d6c38bd54 Consistent bracket alignment 2014-07-18 17:21:58 +02:00
Rossen Stoyanchev 90f8e4b71f Add @Ignored temporarily to Jetty SockJS tests 2014-07-18 00:45:14 -04:00
Rossen Stoyanchev b18ed6b724 Remove erroneously commited code 2014-07-16 20:49:12 -04:00
Rossen Stoyanchev 89b202029a Fix failing test 2014-07-15 22:59:25 -04:00
Rossen Stoyanchev d86e4cf203 Re-obtain port on every WebSocket integration test
This change adds a WebSocketTestServer setup method that initializes
the server and obtains a new port.

In turn AbstractWebSocketIntegrationTests invokes the new method from
its setup method thus ensuring a new port is used on every test.
2014-07-15 16:53:38 -04:00
Rossen Stoyanchev ea7ae8949e Use regex comparison in WebSocket stats test
The output includes thread pool information which appears to not vary
enough to cause failures locally but does so on the build server.
2014-07-15 16:53:38 -04:00
Rossen Stoyanchev 4dd5c274a0 Add missing HandshakeInterceptor for STOMP endpoints
Issue: SPR-11845
2014-07-15 13:31:30 -04:00
Rossen Stoyanchev 6d6cc0ecec Polish WebSocket Java config 2014-07-15 13:31:30 -04:00
Rossen Stoyanchev 85c175059a Add missing handshake-interceptor namespace support
Issue: SPR-11845
2014-07-15 13:31:29 -04:00
Rossen Stoyanchev 61e77eeb61 Fix white spaces 2014-07-15 13:31:29 -04:00
Rossen Stoyanchev 6557800f97 Polish WebSocket namespace 2014-07-15 13:31:29 -04:00
Rossen Stoyanchev ab2526a586 Update support for using "." as path separator
Issue: SPR-11660
2014-07-14 18:49:25 -04:00
Sebastien Deleuze 928a466b5d Allow to customize separator for messaging destinations
In order to be able to use separators like "." (used by default
by most broker relays) instead of "/" for destination patterns
handling, the PathMatcher used in spring-messaging can now
be customized easily thanks to XML websocket namespace
or JavaConfig.

AntPathMatcher has been updated in order to use the configured path
separator instead of an hardcoded "/" for path concatenation.
Extension handling is now disabled when the "." separator is configured.

Issue: SPR-11660
2014-07-14 18:49:24 -04:00
Rossen Stoyanchev 670c216d38 Change converter ordering in message broker config
Issue: SPR-11961
2014-07-10 12:57:00 -04:00
Rossen Stoyanchev 2ebc921545 Add Lifecycle to SockJsClient and Transport types
Issue: SPR-10797
2014-07-10 12:56:59 -04:00
Rossen Stoyanchev d73c1d5693 Update WebSocket client SmartLifecycle support
Before this change WebSocketConnectionManager delegated SmartLifecycle
methods to the client instance it contained. After this change
WebSocketClient implementations are expected to implement Lifecycle
(rather than SmartLifecycle).

The need for this is even more evident with SockJsClient, which is a
WebSocketClient implementation and contains a WebSocketTransport that
in turn contains the actual WebSocketClient. In this case
WebSocketConnectionManager as the top level container is the obvious
place to configure autostartup while Lifecycle events can be
propagated all the way down to the root WebSocketClient.
2014-07-10 12:56:59 -04:00
Juergen Hoeller 3c726aa6c1 Polishing 2014-07-09 21:24:59 +02:00
Rossen Stoyanchev bc62d63fdd Fix left-over merge issue from previous commit 2014-07-09 00:46:06 -04:00
Rossen Stoyanchev 48236be4a2 STOMP and WebSocket messaging related logging updates
This change removes most logging at INFO level and also ensures the
amount of information logged at DEBUG level is useful, brief, and
not duplicated.

Also added is custom logging for STOMP frames to ensure very readable
and consise output.

Issue: SPR-11934
2014-07-09 00:39:59 -04:00
Rossen Stoyanchev ab4864da2a Add STOMP/WebSocket stats collection
This change adds collection of stats in key infrastructure components
of the WebSocket message broker config setup and exposes the gathered
information for logging and viewing (e.g. via JMX).

WebSocketMessageBrokerStats is a single class that assembles all
gathered information and by default logs it once every 15 minutes.
Application can also easily expose to JMX through an MBeanExporter.

A new section in the reference documentation provides a summary of
the available information.

Issue: SPR-11739
2014-07-09 00:39:47 -04:00
Juergen Hoeller b559f15a00 Polishing 2014-07-07 21:45:40 +02:00
Juergen Hoeller 387da221c3 Polishing
Issue: SPR-11963
2014-07-07 19:41:39 +02:00
Brian Clozel 6bcb48f95d Polish SPR-11963 2014-07-07 17:34:08 +02:00
Brian Clozel e549103ca0 Remove Jackson dependency from TransportHandler hierarchy
Prior to this change, AbstractHttpReceivingTransportHandler had a direct
dependency on a Jacckson Exception (checking that exception in a catch
clause). This can cause issues for applications that don't have that
dependency.

This commit removes that direct dependency, still logging the
appropriate log messages using a parent exception (IOException) and
reflection.

Issue: SPR-11963
2014-07-07 17:29:32 +02:00
Rossen Stoyanchev 6d15fcc4a6 Log name of test for WebSocket integration tests
This makes it easier to trace log output on the CI server where the
output is per class.
2014-07-02 14:26:51 -04:00
Rossen Stoyanchev 59e02e63c4 Synchronize request init in AbstractHttpSockJsSession
Although unlikely in practice (but not impossible), the SockJS
integration tests write a message while the request is initializing.
This change adds synchronization around request intiailization
for the SockJS HTTP sesion.

Issue: SPR-11916
2014-07-02 13:53:23 -04:00
Juergen Hoeller e90143e03b Polishing 2014-07-01 12:52:09 +02:00
Rossen Stoyanchev 06d3e1b94e Fix Javadoc typo 2014-06-30 13:27:54 -04:00
Rossen Stoyanchev 71b942698d Fix sniff task warnings 2014-06-29 22:56:53 -04:00
Rossen Stoyanchev b1aebb2c0c Fix failing test 2014-06-29 22:09:54 -04:00
Rossen Stoyanchev cb40908a7d Fix warnings from the sniff task 2014-06-29 17:35:00 -04:00
Rossen Stoyanchev 2b1ff4c5db Fix condition in SubProtocolWebSocketHandler
Issue: SPR-11884
2014-06-29 17:00:24 -04:00
Rossen Stoyanchev 7441f23012 Add support for removeOnCancelPolicy
This change removes the recently added SockJsThreadPoolTaskScheduler
and instead builds support for the removeOnCancelPolicy property in
ThreadPoolTaskScheduler and ScheduledExecutorFactoryBean.

Issue: SPR-11918
2014-06-29 14:28:52 -04:00
Rossen Stoyanchev 7dc2b2927e Use SESSION_NOT_RELIABLE when no messages received
When a WebSocket session is closed after not having received any
messages, we'll use SESSION_NOT_RELIABLE to indicate to other parts
of the session closing code not to send anything further (e.g.
SockJS "Go Away!" frame).

Issue: SPR-11884
2014-06-29 13:15:21 -04:00
Rossen Stoyanchev 3af488a701 Avoid multiple invocations of afterConnectionClosed
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.

Issue: SPR-11884
2014-06-29 13:15:21 -04:00
Rossen Stoyanchev 86de416908 More WebSocket logging updates
Update WebSocketSession toString methods to include the handshake URI
and add id and URI fields to ensure they're available after close().

Log WebSocket session open and close events at INFO.

Remove trace messages for destinations that do not match.

Issue: SPR-11884
2014-06-29 13:15:02 -04:00
Rossen Stoyanchev 1c91a52639 Add STOMP subscribe/unscubscribe ApplicationContext events
Issue: SPR-11813
2014-06-28 11:07:42 -04:00
Rossen Stoyanchev 7a5b3c1eed Append suffx to user dest in SimpMessagingTemplate
Isssue: SPR-11868
2014-06-27 12:43:52 -04:00
Rossen Stoyanchev 113fd1180a Fine tune STOMP and WebSocket related logging
Optimize logging with tracking the opening and closing of WebSocket
sessions and STOMP broker connections in mind.

While the volume of messages makes it impractical to log every message
at anything higher than TRACE, the opening and closing of connections
is more manageable and can be logged at INFO. This makes it possible to
drop to INFO in production and get useful information without getting
too much in a short period of time.

The logging is also optimized to avoid providing the same information
from multiple places since messages pass through multiple layers.

Issue: SPR-11884
2014-06-27 04:06:06 -04:00
Brian Clozel b2f6445058 Fix unit test for SPR-11919
Issue: SPR-11919
2014-06-27 10:01:27 +02:00
Brian Clozel 24cdefb785 Workaround for WFLY-3474 NullPointerException
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
2014-06-26 23:47:10 +02:00
Rossen Stoyanchev 9796af72db Improve JettySockJsIntegrationTests to show real error
In a recent CI build failure a test timed out waiting for a message:
https://build.spring.io/browse/SPR-PUB-1316

In fact there was a WebSocket transport failure originating in Jetty's
WebSocket Parser. However this failure is only apparent by looking at
the logs. This change adds a check if a transport error ocurred while
we were waiting and throws an AssertionError.
2014-06-26 10:07:00 -04:00
Rossen Stoyanchev a3fa9c9797 Add check for unused WebSocket sessions
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.

Issue: SPR-11884
2014-06-26 10:07:00 -04:00
Juergen Hoeller 98d6f7b443 Polishing 2014-06-26 16:01:24 +02:00
Juergen Hoeller 8ea0d8eea1 Latest dependency updates (AspectJ 1.8.1, Reactor 1.1.2, Tomcat 8.0.9, Jackson 2.4.1, JAMon 2.76) 2014-06-26 12:21:21 +02:00
Rossen Stoyanchev 0f47732523 Fix failing test 2014-06-25 15:51:42 -04:00
Rossen Stoyanchev 6ad79e03c6 Create SockJS ThreadPoolTaskScheduler extension
Commit 5d2e6f enabled the setRemoveOnCancelPolicy of the SockJS
ScheduledThreadPoolExecutor by default. However that property is only
available in JDK 1.7 or later. This change fixes the issue and
introduces an extension of ThreadPoolTaskScheduler for for use with
SockJS which is necessary in any case since ThreadPoolTaskScheduler
does not expose the underlying ScheduledThreadPoolExecutor otherwise.

Issue: SPR-11918
2014-06-25 15:08:42 -04:00
Rossen Stoyanchev 1e342e4dbf Use SimpleAsyncTaskExecutor in WebSocketClient impls
JettyWebsocketClient and StandardWebSocketClient now use the
SimpleAsyncTaskExecutor by default to ensure non-blocking connect.
2014-06-25 14:09:42 -04:00
Rossen Stoyanchev 5d2e6f6d4c Prevent unbounded retention of cancelled SockJS tasks
This change sets the removeOnCancelPolicy on the SockJS
ScheduledThreadPoolExecutor to true. This ensures that cancelled
tasks are removed immediately to avoid the "unbounded retention
of cancelled tasks" that is mentioned in the Javadoc of
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."

Issue: SPR-11918
2014-06-25 14:09:42 -04:00
Rossen Stoyanchev fcf6ae8328 Fix concurrency issues in SockJS session impls
This change ensures the server "WebSocketHandler" is notified of the
opening of a session before writing the open frame to the remote
handler. Any messages sent by the server "WebSocketHandler" while
getting notified of the opening get cached and flushed after the open
frame has been written.

This change introduces locking in AbtractHttpSockJsSession to guard
access to the HTTP response. The goal is to prevent contention between
client requests to receive messages (i.e. long polling) and
the application trying to write.

Issue: SPR-11916
2014-06-25 14:09:42 -04:00
Rossen Stoyanchev e82df99a22 Add SockJS client
This change adds a new implementation of WebSocketClient that can
connect to a SockJS server using one of the SockJS transports
"websocket", "xhr_streaming", or "xhr". From a client perspective
there is no implementation difference between "xhr_streaming" and
"xhr". Just keep receiving and when the response is complete,
start over. Other SockJS transports are browser specific
and therefore not relevant in Java ("eventsource", "htmlfile" or
iframe based variations).

The client loosely mimics the behavior of the JavaScript SockJS client.
First it sends an info request to find the server capabilities,
then it tries to connect with each configured transport, falling
back, or forcing a timeout and then falling back, until one of the
configured transports succeeds.

The WebSocketTransport can be configured with any Spring Framework
WebSocketClient implementation (currently JSR-356 or Jetty 9).

The XhrTransport currently has a RestTemplate-based and a Jetty
HttpClient-based implementations. To use those to simulate a large
number of users be sure to configure Jetty's HttpClient executor
and maxConnectionsPerDestination to high numbers. The same is true
for whichever underlying HTTP library is used with the RestTemplate
(e.g. maxConnPerRoute and maxConnTotal in Apache HttpComponents).

Issue: SPR-10797
2014-06-25 13:56:04 -04:00
Rossen Stoyanchev dc1d85d045 Support registering Filters in WebSocket test servers 2014-06-25 08:50:26 -04:00
Rossen Stoyanchev c14ba1a0ff Add SockJsFrameType enum
SPR-10797
2014-06-25 08:50:26 -04:00
Rossen Stoyanchev c86f711de5 Polish SockJsFrame 2014-06-25 08:50:26 -04:00
Juergen Hoeller 18131bf611 Consistent declaration of private static final logger variables
Issue: SPR-11905
2014-06-24 14:02:05 +02:00
Rossen Stoyanchev c809143cc4 Upgrade to Undertow 1.0.15 and fix failing test
Issue: SPR-11777
2014-06-11 17:45:19 -04:00
Rossen Stoyanchev fc91add35e Allow custom UrlPathHelper for WebSocket requests
Issue: SPR-117711
2014-06-09 17:42:43 -04:00
Rossen Stoyanchev 9706e5cc99 Update Javadoc on SockJS client library URL
Issue: SPR-11766
2014-06-06 10:32:04 -04:00
Juergen Hoeller f7b465390c Moved @Uses annotations to org.springframework.lang; fixed Base64Utils to declare Java 8, and fixed PathResource's declaration to refer to Java 7.
Issue: SPR-11604
2014-06-04 21:34:23 +02:00
Rossen Stoyanchev 4372dac002 Polish 2014-05-30 12:04:32 -04:00
Artem Bilan 0dddb6f3e1 Fix issue with StompSubProtocolHandler initialization
This change ensures that StompSubProtocolHandler is injected with an
ApplicationEventPublisher for both the Java and XML config.

Issue: SPR-11825
2014-05-30 12:04:32 -04:00
Juergen Hoeller 2750ab6734 Undertow-related polishing 2014-05-12 23:14:16 +02:00
Rossen Stoyanchev 2c4cbb617e Add WebSocket scope
This change adds support for a custom "websocket" scope.

WebSocket-scoped beans may be injected into controllers with message
handling methods as well as channel interceptor registered on the
"inboundClientChannel".

Issue: SPR-11305
2014-05-11 12:31:17 -04:00
Rossen Stoyanchev 66c63c374b Ensure handshake attrs are copied in SockJS session 2014-05-09 17:01:37 -04:00
Rossen Stoyanchev 97fb308b6b Allow use of @SendToUser even w/o authenticated user
Before this change, subscribing to a user destination and use of
@SendToUser annotation required an authenticated user.

This change makes it possible to subscribe to a user destination from
WebSocket sessions without an authenticated user. In such cases the
destination is associated with one session only rather than with a
user (and all their sessions).

It is then also possible to send a message to a user destination
via "/user/{sessionId}/.." rather than "/user/{user}/...".

That means @SendToUser works relying on the session id of the input
message, effectively sending a reply to destination private to the
session.

A key use case for this is handling an exception with an
@MessageExceptionHandler method and sending a reply with @SendToUser.

Issue: SPR-11309
2014-05-08 22:06:57 -04:00
Rossen Stoyanchev ae30a60d03 Relax websocket xsd attr types for ${} style props
Issue: SPR-11624
2014-05-02 15:17:04 -04:00
Rossen Stoyanchev 209bb4ee4b Fix Javadoc typo 2014-04-30 10:06:57 -04:00
Stephane Nicoll bd85c916eb Integrate animal sniffer
Animal sniffer provides tools to assist verifying that classes
compiled with a newer JDK are compatible with an older JDK.

This integratesthe latest version of the tool (1.11) that
permits the use of custom annotations. Added @UsesJava7,
@UsesJava8 and @UsesSunHttpServer and annotated the few places
where we rely on a specific environment.

The verification process can be invoked by running the 'sniff'
task.

Issue: SPR-11604

polishing
2014-04-30 13:51:01 +02:00
Juergen Hoeller 6cb45f714e General defensiveness about the bootstrap ClassLoader (i.e. null ClassLoader)
Issue: SPR-11721
(cherry picked from commit 59cef3c)
2014-04-28 00:47:21 +02:00
Rossen Stoyanchev 1200755125 Fix issue with subscribe destination
The original fix for SPR-11423:
32e5f57e64

was insufficient when using an external broker since the original
destination header has to be in the "native headers" map (i.e. with
STOMP headers) in order to be included in messages broadcast by
the broker.
2014-04-25 12:26:04 -04:00
Stephane Nicoll 5559209233 Remove useless imports 2014-04-22 09:57:12 +02:00
Philippe Marschall e98d3f790b Clean up spring-websocket imports
spring-websocket is full of unused imports. This commit removes all
unused imports from spring-websocket.
2014-04-22 07:28:56 +02:00
Juergen Hoeller 48c977afdc Polishing 2014-04-17 21:19:47 +02:00
Rossen Stoyanchev 4e1781ae8c Use strategy for customizing ID/TIMESTAMP generation
Issue: SPR-11468
2014-04-14 21:03:13 -04:00
Rossen Stoyanchev 65b17b80ba Switch BufferingStompDecoder to decoration
The BufferingStompDecoder now decorates rather than extend
StompDecoder. This allows a single StompDecoder instance to be
configured and extended independantly while buffering remains a
separate concern.
2014-04-13 21:35:22 -04:00
Rossen Stoyanchev ae942ffdb8 Make use of enhanced MessageHeaderAccessor support
Mutate rather than re-create headers when decoding STOMP messages
before a message is sent on a message channel.

Use MessageBuilder.createMessage to ensure the fully prepared
MessageHeaders is used directly MessageHeaderAccessor instance.

Issue: SPR-11468
2014-04-13 18:43:25 -04:00
Rossen Stoyanchev 4867546aec Enhance MessageHeaderAccessor support
Refine semantics of ID and TIMESTAMP headers provided to protected
MessageHeaders constructor.

Refactor internal implementation of MessageHeaderAccessor.

Support mutating headers from a single thread while a message is being
built (e.g. StompDecoder creating message + then adding session id).

Improve immutablity in NativeMessageHeaderAccessor and in
StompHeaderAccessor.

Optimize object creation for initializing messages and subsequent
accessing their headers.

Introduce MessageHeaderAccessorFactory support to enable applying a
common strategies for ID and TIMESTAMP generation to every message.

Add MessageBuilder shortcut factory method for creating messages from
payload and a full-prepared MessageHeaders instance. Also add
equivalent constructors to GenericMessage and ErrorMessage.

Issue: SPR-11468
2014-04-13 18:43:25 -04:00
Rossen Stoyanchev 5e925ac03c Rename header for "orig" destination
The UserDestinationMessageHandler adds a header providing a hint for
what the original destination a user may have used when subscribing.
That is then used when writing messages back to WebSocket clients to
ensure they dont see the internally used, transformed user destination.

This change moves the header name constatn to make it more broadly
applicable. For example SPR-11645.
2014-04-04 14:31:49 -04:00
Brian Clozel ec0b672baa Fix @SubscribeMapping MESSAGE response destination
Prior to this commit, @SubscribeMapping mapped methods (backed with
@SendTo* annotations, or not) would send MESSAGEs with the wrong
destination. Instead of using the original SUBSCRIBE destination, it
would use the lookup path computed from the configured prefixes in the
application.

This commit fixes this issue - now @SubscribeMapping MESSAGEs use the
original SUBSCRIBE destination.

Issue: SPR-11648
2014-04-04 12:43:35 +02:00
Rossen Stoyanchev 990f5bb720 Improve handling of disconnects in STOMP broker relay
Issue: SPR-11655
2014-04-03 22:31:10 -04:00
Rossen Stoyanchev 8edbdf4ddb Fix failing test 2014-04-01 13:33:09 -04:00
Rossen Stoyanchev 8ab8448148 Move tests to packages where they belong 2014-04-01 13:16:51 -04:00
Rossen Stoyanchev 73ecbc047c Update JettyWebSocketSession
Ensure the JettyWebSocket session can return the Principal and accepted
WebSocket sub-protocol even after the session is closed.

Issue: SPR-11621
2014-04-01 13:13:55 -04:00
Sebastien Deleuze a805f12374 Make WebSocket fields available after it is closed
Update some native WebSocket session getters to return basic
information after it is closed. It is required for example in
SubProtocolWebSocketHandler#afterConnectionEstablished() or
StompSubProtocolHandler#afterSessionStarted().

Issue: SPR-11621
2014-04-01 11:26:22 -04:00
Rossen Stoyanchev 6ec3de6029 Fix issue with default executor for broker channel
The default for the broker channel should be "no executor".

Issue: SPR-11623
2014-04-01 11:18:28 -04:00
Sebastien Deleuze fb7d81c4a2 Fix <websocket:interceptors> default configuration
Adding a ChannelInterceptor does not suppress default executor
settings anymore in the XML namespace.

Issue: SPR-11623
2014-04-01 10:49:09 -04:00
Rossen Stoyanchev ace6bd2418 Improve shutdown responsiveness of SubProtocolWSH
Proactively notify all active WebSocket sessions when a shutdown is
progress. Sessions then can ignore further attempts to send messages
and also stop stop trying to flush messages right away.
2014-03-27 20:15:53 -04:00
Rossen Stoyanchev 3347b45292 Provide more accurate error message 2014-03-26 11:32:34 -04:00
Rossen Stoyanchev bbf101eef6 Fix issue in last commit 2014-03-25 09:59:09 -04:00
Rossen Stoyanchev a247d5f2e8 Guard against exceptions from ApplicationListener
Issue: SPR-11578
2014-03-25 09:05:42 -04:00
Rossen Stoyanchev 1c1e1145a2 Allow configuring WebSocket message size in a session
Issue: SPR-11575
2014-03-25 00:27:05 -04:00
Rossen Stoyanchev 5caf36ae91 Update default pools size for SockJS scheduler
This change updates the XML namespace to match a change already made
to the Java config.
2014-03-24 21:44:03 -04:00
Rossen Stoyanchev 13da7057e6 Add session lifecycle ApplicationEvent's
Issue: SPR-11578
2014-03-24 20:30:41 -04:00
Rossen Stoyanchev c11484b2e7 Add WebSocket transport configuration support
Issue: SPR-11527
2014-03-24 19:20:38 -04:00
Rossen Stoyanchev 1e9960e1ce Add WebSocketTransportRegistration
Issue: SPR-11527
2014-03-24 19:20:38 -04:00
Rossen Stoyanchev 545c4effb1 Polish StompDecoder and the new Buffering sub-class
Issue: SPR-11527
2014-03-24 19:20:37 -04:00
Sebastien Deleuze bbdb72d808 Add configuration for message buffer size limit
BufferingStompDecoder message buffer size limit can now be configured
with JavaConfig MessageBrokerRegistry.setMessageBufferSizeLimit() or
with XML <websocket:message-brocker message-buffer-size="">.

Issue: SPR-11527
2014-03-24 19:20:37 -04:00
Rossen Stoyanchev ebffd67b5e Add BufferingStompDecoder
Before this change the StompDecoder decoded and returned only the first
Message in the ByteBuffer passed to it. So to obtain all messages from
the buffer, one had to loop passing the same buffer in until no more
complete STOMP frames could be decoded.

This chage modifies StompDecoder to return List<Message> after
exhaustively decoding all available STOMP frames from the input buffer.
Also an overloaded decode method allows passing in Map that will be
populated with any headers successfully parsed, which is useful for
"peeking" at the "content-length" header.

This change also adds a BufferingStompDecoder sub-class which buffers
any content left in the input buffer after parsing one or more STOMP
frames. This sub-class can also deal with fragmented messages,
re-assembling them and parsing as a whole message.

Issue: SPR-11527
2014-03-24 19:20:37 -04:00
Rossen Stoyanchev 15188a8eee Document IE 8 and 9 related SockJS transport details
Issue: SPR-11496, SPR-11525
2014-03-23 22:52:13 -04:00
Rossen Stoyanchev 7af74b2475 Disable SockJS heartbeat if STOMP heartbeat is on 2014-03-23 02:12:57 -04:00
Rossen Stoyanchev 2c6d6b524d Adjust SockJS scheduler core pool size
Issue: SPR-11556
2014-03-23 01:04:30 -04:00
Rossen Stoyanchev 7651f83b4c Polish 2014-03-23 01:01:39 -04:00
Rossen Stoyanchev cbd5af3a03 Add CloseStatus to indicate unreliable session
When a send timeout is detected, the WebSocket session is now closed
with a custom close status that indicates so. This allows skipping
parts of the close logic that may cause further hanging.

Issue: SPR-11450
2014-03-23 00:51:33 -04:00
Rossen Stoyanchev 4028a3b0bc Remove synchronized keywords from SockJsSession impls
Before this change SockJsSession implementations of WebSocketSession
used synchronization around its method implementations protecting
internal state and ensuring only a single thread is sending messages
at a time.

A WebSocketSession is generally expected to be used from one thread
at a time and now that application messages are sent through
ConcurrentWebSocketSessionDecorator, there is no concern about
application messages sent from the different threads.

While there are some remaining concerns, those can be addressed
without using the synchronized keyword. This change removes it from
the methods of all SockJS session implementations.

Issue: SPR-11450
2014-03-22 22:59:48 -04:00
Rossen Stoyanchev ffac748f1c Improve ConcurrentWebSocketSessionDecorator
Before this change the decorator ensured that for a specific WebSocket
session only one thread at a time can send a message. Other threads
attempting to send would have their messages buffered and each time
that occurs, a check is also made to see if the buffer limit has been
reached or the send time limit has been exceeded and if so the session
is closed.

This change adds further protection to ensure only one thread at a time
can perform the session limit checks and attempt to close the session.
Furthermore if the session has timed out and become unresponsive,
attempts to close it may block yet another thread. Taking this into
consideration this change also ensures that state associated with the
session is cleaned first before an attempt is made to close the session.

Issue: SPR-11450
2014-03-22 22:59:39 -04:00
Rossen Stoyanchev 299be08268 Remove synchronized block around WebSocketSession.send
Since we now wrap the WebSocketSession with a concurrent decorator, the
synchronized keyword around message sending needed to be removed.

Issue: SPR-11586
2014-03-21 11:42:23 -04:00
Brian Clozel 26309838ba Set custom handshakeHandler for XML sockjs config
Prior to this commit, configuring a custom handshakeHandler when setting
up a stomp-endpoint with SockJS would not be taken into account:

  <websocket:stomp-endpoint path="/foo">
    <websocket:handshake-handler ref="customHandler"/>
    <websocket:sockjs/>
  </websocket:stomp-endpoint>

This commit fixes this by creating and registering a
WebsocketTransportHandler (with this handshakeHandler) as a
transportHandler override for the SockJSService.

Issue: SPR-11568
2014-03-21 10:00:11 +01:00
Rossen Stoyanchev b7a974116e Add concurrent WebSocket session decorator (temp commit)
Issue: SPR-11586
2014-03-21 01:29:29 -04:00
Rossen Stoyanchev ac968e94ed Add getter for the length of a WebSocket message 2014-03-20 21:19:18 -04:00
Stephane Nicoll 4cd818b9e4 Harmonize log configuration
Prior to this commit, the codebase was using a mix of log4j.xml
and log4j.properties for test-related logging configuration. This
can be an issue as log4j takes the xml variant first when looking
for a default bootstrap configuration.

In practice, some modules declaring the properties variant were
taking the xml variant configuration from another module.

The general structure of the configuration has also been
harmonized to provide a standard console output as well as an
easy way to enable trace logs for the current module.
2014-03-20 09:43:29 -07:00
Rossen Stoyanchev 10af128e96 Update thread pool settings in STOMP/WebSocket config
The clientInboundChannel and clientOutboundChannel now use twice
the number of available processors by default to accomodate for some
degree of blocking in task execution on average.

In practice these settings still need to be configured explicitly in
applications but these should serve as better default values than
the default values in ThreadPoolTaskExecutor.

Issue: SPR-11450
2014-03-20 00:45:37 -04:00
Rossen Stoyanchev 1bab8a3916 Add session attributes to SimpMessageHeaderAccessor
This change exposes the WebSocketSession attributes through a message header.
The StompSubProtocolHandler adds this to incoming messages.
For now messaging handling  methods can access the map via @Header, e.g.:

@Header(StompHeaderAccessor.SESSION_ATTRIBUTES) Map<String, Object> attrs) {

Issue: SPR-11566
2014-03-19 13:45:40 -04:00
Rossen Stoyanchev 48b62e80d5 Rename handshakeAttributes to just attributes
Issue: SPR-11566
2014-03-19 12:25:08 -04:00
Rossen Stoyanchev 9552c82e2d Remove use of simple executor in WebSocket clients
Issue: SPR-11580
2014-03-19 10:24:48 -04:00
Juergen Hoeller 373f07b1ff Polishing 2014-03-18 22:30:32 +01:00
Rossen Stoyanchev 6bcbb94aba Refine BrokerAvailabilityEvent behavior
Add accessor for brokerAvailable in AbstractBrokerMessageHandler
Ensure brokerAvailable is set even if eventPublisher is not
Add tests BrokerMessageHandlerTests

Turn off brokerAvailable when StompBrokerRelayMessageHandler stops
Actually stop message handling when brokerAvailable=false
Improve log messages

Issue: SPR-11563
2014-03-16 18:12:45 -04:00
Sam Brannen a006ca2542 Remove trailing whitespace 2014-03-13 12:21:32 +01:00
Brian Clozel 8b2b165777 Fix "relay-port" XSD type in spring-websocket.xsd
Prior to this commit, the `relay-port` attribute of the
`<websocket:stomp-broker-relay />` tag was of type `xsd:int`.
This prevents developers from using `PropertyPlaceholderConfigurer`,
even though this configuration key is a good candidate for such use
(this value depends on prod/staging/etc environment).

This commit changes that type to `xsd:string`.

Issue: SPR-11537
2014-03-11 20:33:13 +01:00
Rossen Stoyanchev cff23b84ae Add messages for number of active sessions/connections
Issue: SPR-11531
2014-03-10 16:58:02 -04:00
Rossen Stoyanchev 49d7bda722 Improve CORS handling in AbstractSockJsService
After this change, AbstractSockJsService does not add CORS headers if
the response already contains an "Access-Control-Allow-Origin" header.
Essentially it backs off assuming CORS headers are handled centrally
e.g. through a Filter.

In order to support this, the ServletServerHttpResponse now returns an
instance of HttpHeaders that also provides access to headers already
present in the HttpServletResponse.

Issue: SPR-11443
2014-03-05 21:06:46 -05:00
Rossen Stoyanchev a434903a2a Adjust log level in LoggingWebSocketHandlerDecorator 2014-03-05 11:13:41 -05:00
Sam Brannen 9891bdc7b4 Clean up "abstract" test issues
- Deleted empty AbstractWebSocketClientTests class.

 - AbstractServletHandlerMethodTests and AbstractHttpRequestTests are
   now actually declared as abstract.

 - The following classes are not abstract but currently have an
   "Abstract" prefix and therefore get ignored by the Gradle build.
   This commit renames each of these by deleting the "Abstract" prefix.

   - AbstractFlashMapManagerTests
   - AbstractMappingContentNegotiationStrategyTests
   - AbstractSockJsServiceTests
   - AbstractWebSocketHandlerRegistrationTests
2014-03-05 12:41:26 +01:00
Sam Brannen b42f258c54 Use unmodifiable set in AbstractSockJsSession 2014-03-05 11:04:06 +01:00
Sam Brannen 8f3a897502 Polish AbstractSockJsSession 2014-03-02 16:21:48 +01:00
Rossen Stoyanchev 4238299661 Add smart logging for disconnected SockJS clients
The Servlet API does not provide notifications when a client
disconnects, see see https://java.net/jira/browse/SERVLET_SPEC-44.
Therefore network IO failures may occur simply because a client has
gone away. Before this change that could fill logs with unnecessary
stack traces.

After this change we make a best effort to identify such network
failures, on a per-server basis (tested with Jetty, Tomcat, Glassfish,
and WildFly), and log them under a separate log category.

A simple one-line message is logged at DEBUG level (i.e. no stack trace)
while a full stack trace is shown at TRACE level.

Issue: SPR-11438
2014-03-01 14:46:44 -05:00
Rossen Stoyanchev 6016536055 Remove ContentTypeResolver from composite converter
Before this change CompositeMessageConverter had a ContentTypeResolver
field that was in turn set on all contained converters.

After this change that field is removed and effectively
CompositeMessageConverter is a simple container of other converters.
Each converter in turn must have been configured with a
ContentTypeResolver.

Doing so means it is less likely to have unexpected consequences when
configuring converters, the ContentTypeResolver set in the composite
converter overriding the one configured in a contained converter.

Also commit 676ce6 added default ContentTypeResolver initialization
to AbstractMessageConverter, which ensures that converters are still
straight forward to configure.

Issue: SPR-11462
2014-02-27 21:41:35 -05:00
Rossen Stoyanchev 32e5f57e64 Ensure matching user destination returned
Before this change, when a client subscribed to a "user" destination
(e.g. /user/foo), actual messages received in response to that
subscription contained the server-translated, unique user destination
(e.g. /foo-user123).

This is not an issue for clients such as stomp.js since the
subscription is unique and sufficient to match subscription responses.
However, other STOMP clients do additional checks on the destination
of the subscription and the response.

This change ensures that messages sent to clients on user destionations
always contain a destination that matches the one on the original
subscription.

Issue: SPR-11423
2014-02-13 16:38:56 -05:00
Rossen Stoyanchev dfe2234781 Upgrade to Undertow 1.0 Final (WildFly 8 Final) 2014-02-12 11:06:51 -05:00
Rossen Stoyanchev 1c4530f251 Re-enable Undertow tests in WebSocketConfigurationIT 2014-01-22 14:50:25 -05:00
Rossen Stoyanchev 8ee2a2d18c Remove unused constructor arg from UserDestinationMH 2014-01-22 11:55:44 -05:00
Rossen Stoyanchev 0db2f79bdb Polish message method handling tests 2014-01-22 11:29:38 -05:00
Sam Brannen 597ef099d0 Suppress warnings and remove unused imports 2014-01-22 12:23:32 +01:00
Juergen Hoeller 12c393eb6d Switched 'order' attributes across namespaces to 'xsd:token'
Issue: SPR-10886
Issue: SPR-7342
2014-01-22 11:35:21 +01:00
Juergen Hoeller 3969467851 Temporarily deactivated Undertow integration tests
Undertow tests fail against OpenJDK 8 build 124 with a BindException.
2014-01-22 11:34:27 +01:00