Commit Graph

1188 Commits

Author SHA1 Message Date
Rossen Stoyanchev 1472e9795f Update SpringConfiguration to support beans by type
Issue: SPR-10605
2013-08-28 22:51:39 -04:00
Rossen Stoyanchev f0dda0e38b Add WebSocket integration tests w/ Java configuration
Issue: SPR-10835
2013-08-28 21:11:05 -04:00
Rossen Stoyanchev 4b2847d9d1 Add ChannelInterceptor to spring-messaging module
Issue: SPR-10866
2013-08-28 14:41:20 -04:00
Rossen Stoyanchev 467a6b9fa7 Fix failing tests and upgrade websocket to Jetty 9.0.5 2013-08-28 08:43:53 -04:00
Rossen Stoyanchev 4c0da5867a Add Java config support for WebSocket and STOMP
Issue: SPR-10835
2013-08-27 22:20:07 -04:00
Rossen Stoyanchev 750930fa25 Fix bug with the order of messaging arg resolvers 2013-08-27 15:05:34 -04:00
Rossen Stoyanchev 402a3b8473 Fix javadoc 2013-08-27 12:48:48 -04:00
Jan Machacek 3f130a1c08 Add support for custom types in AMMH 2013-08-27 12:43:21 -04:00
Rossen Stoyanchev 68c0df8305 Polish StompBrokerRelayMessageHandler 2013-08-19 21:16:00 -04:00
Rossen Stoyanchev 94fefec0f9 Add ActiveMQ-based STOMP relay integration tests 2013-08-19 21:16:00 -04:00
Andy Wilkinson 3fb5ff2654 Improve broker availability events
Use a single class for the broker availability event with a boolean
that indicates whether or not the broker is available, rather than one
event for an available broker and one event for an unavailable broker.

Publish broker availability events in SimpleBrokerMessageHandler so that
it can be used as a drop-in replacement for
StompBrokerRelayMessageHandler.
2013-08-19 21:16:00 -04:00
Andy Wilkinson 131b5de6f9 Add reconnect logic to the relay's system session
Upgrade to Reactor snapshot builds to take advantage of TcpClient's
reconnect support that was added post-M1. Now, the system relay session
will try every 5 seconds to establish a connection with the broker, both
when first connecting and in the event of subsequently becoming
disconnected.

A more sophisticated reconnection policy, including back off and
failover to different brokers, is possible with the Reactor API. We may
want to enhance the relay's reconnection policy in the future.

Typically, a broken connection is identified by the failure to forward
a message to the broker. As things stand, the message id then discarded.
Any further messages that are forwarded before the connection's been
re-established are queued for forwarding once the CONNECTED frame's been
received. We may want to consider also queueing the message that failed
to send, however we would then need to consider the possibility of the
message itself being what caused the broker to close the connection
and resending it would simply cause the connection to be closed again.
2013-08-19 21:15:59 -04:00
Andy Wilkinson 8b48d8f445 Publish events about broker's availability
Components that are using a StompBrokerRelayMessageHandler may want
to know whether or not the broker's unavailable. If they're sending
messages to the relay via an asynchronous channel there's currently
no way for them to find this out.

This commit enhances StompBrokerRelayMessageHandler to publish
application events when the broker's availability changes:
BrokerBecameAvailableEvent and BrokerBecameUnavailableEvent.
Irrespective of the number of relay sessions only a single event is
published for each change in the broker's availability.
2013-08-19 21:15:59 -04:00
Andy Wilkinson be6dbe54a3 Integration tests for the broker relay 2013-08-19 21:15:59 -04:00
Rossen Stoyanchev 01feae0ad5 Polish WebSocketSession
Update methods available on WebSocketSession interface.
Introduce DelegatingWebSocketSession interface.
2013-08-13 17:28:00 -04:00
Rossen Stoyanchev 0d5901ffb6 Polish Cookie abstraction in http packge of spring-web
A getCookies method is now available on ServerHttpRequest with one
ServletServerCookie implementation that wraps a Servlet cookie.

The SockJS service makes use of this to check for an existing session
cookie in the request.
2013-08-02 12:30:43 -04:00
Andy Wilkinson 9e20a25607 Introduce SubProtocolHandler abstraction
Add SubProtocolHandler to encapsulate the logic for using a
sub-protocol.

A SubProtocolWebSocketHandler is also provided to
delegate to the appropriate SubProtocolHandler based on the
negotiated sub-protocol value at handshake.

StompSubProtocolHandler provides handling for STOMP messages.

Issue: SPR-10786
2013-08-01 17:31:27 -04:00
Andy Wilkinson 4390591b68 Make BeanFactoryMCDR BeanFactoryAware
SI's BeanFactoryChannelResolver was BeanFactoryAware. This commit
brings Spring's BeanFactoryMessageChannelDestinationResolver in line
with the old SI class.
2013-07-24 16:45:52 -04:00
Rossen Stoyanchev 02949fc4a7 Fix failing tests 2013-07-21 20:39:07 -04:00
Rossen Stoyanchev b3c7c18c1b Add MessageHandler destination prefix checks 2013-07-21 12:07:50 -04:00
Rossen Stoyanchev 2cdac267f7 Add MessageMethodArumentResolver 2013-07-21 12:07:50 -04:00
Rossen Stoyanchev 90c4712d06 Revise UserSessionResolver to UserQueueSuffixResolver
The resolver for /user/{username} prefixed destinations is now
more explicitly designed to store queue suffixes rather than session
id's, which is what we happen to use as queue suffixes.

This allows something other than the sessionId to be used without
having to change many places. It also enables applications to
construct destinations with user-specific queue suffixes without
making assumptions about what's used for queue suffixes. For
example a controller may construct a map with subscription destinations
and send that down to the client.
2013-07-19 17:22:58 -04:00
Rossen Stoyanchev 3272917cf2 Polish concurrency in UserSessionResolver impl 2013-07-19 10:57:23 -04:00
Rossen Stoyanchev aa6f30482f Reverse change committed erroneously 2013-07-17 23:00:17 -04:00
Rossen Stoyanchev a109d6adc7 Set heartbeat to 0,0 on CONNECT to message broker 2013-07-17 22:40:44 -04:00
Rossen Stoyanchev 8a8501a992 Polish 2013-07-17 18:23:27 -04:00
Rossen Stoyanchev 329fbf31bc Fix concurrency issue in DefaultSubscriptionRegistry 2013-07-17 18:16:39 -04:00
Rossen Stoyanchev d73c2e26a5 Polish handling of STOMP message headers 2013-07-17 13:58:45 -04:00
Rossen Stoyanchev ba7998d03b Add SimpMessageSendingOperations 2013-07-17 10:09:55 -04:00
Rossen Stoyanchev 078cfb3e78 Add @ReplyTo/@ReplyToUser, remove deps on spring-web 2013-07-16 22:07:46 -04:00
Rossen Stoyanchev 55dae74f15 Add ReplyTo annotation 2013-07-16 10:24:45 -04:00
Rossen Stoyanchev e0d393eed3 Fix issue in STOMP broker relay 2013-07-15 17:45:54 -04:00
Rossen Stoyanchev 5d20b75dc2 Add support for sending private messages
The new UserDestinationMessageHandler resolves messages with
destinations prefixed with "/user/{username}" and resolves them into a
destination to which the user is currently subscribed by appending the
user session id.

For example a destination such as "/user/john/queue/trade-confirmation"
would resolve "/trade-confirmation/i9oqdfzo" assuming "i9oqdfzo" is the
user's session id.
2013-07-14 21:10:15 -04:00
Rossen Stoyanchev 2a48ad88fb Refactor and polish spring-messaging
Remove base class for STOMP-related message handler classes
(AbstractSimpMessageHandler), polish subclasses and fix issues with
more significant updates to STOMP broker relay.

Introduce base class for SubscribableChannel implementations providing
consistent logging for all channel implementations.
2013-07-13 19:05:32 -04:00
Rossen Stoyanchev f5f3f66b13 Add user-name header to CONNECTED frame 2013-07-12 19:42:31 -04:00
Rossen Stoyanchev bd68fefc6f Fix issue with clearing subscriptions on disconnect 2013-07-12 15:30:12 -04:00
Rossen Stoyanchev 210be9cde4 Add PrincipalMessageArgumentResolver 2013-07-12 15:15:37 -04:00
Rossen Stoyanchev d3cecfc6cc Create spring-messaging module
Consolidates new, messaging-related classes from spring-context and
spring-websocket into one module.
2013-07-12 13:44:41 -04:00