diff --git a/README.md b/README.md index 71aac70..da7a000 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,22 @@ spring-stomp-chat ================= + +This is the sourcecode for the [theotherian's blog article](http://www.theotherian.com/2014/03/spring-boot-websockets-stomp-chat.html). + +See also [the documentation of stomp in spring](http://docs.spring.io/spring/docs/current/spring-framework-reference/html/websocket.html#websocket-stomp-overview). + +```sh +mvn package +java -jar ./target/spring-stomp-chat-trunk-SNAPSHOT.jar +``` + +The accounts available are: + +```java + auth.inMemoryAuthentication().withUser("ian").password("ian").roles("USER"); + auth.inMemoryAuthentication().withUser("dan").password("dan").roles("USER"); + auth.inMemoryAuthentication().withUser("chris").password("chris").roles("USER"); +``` + +Please note you need to users to login and one of them to select the other to open the chat window. + diff --git a/pom.xml b/pom.xml index a86fa72..9f2cae0 100644 --- a/pom.xml +++ b/pom.xml @@ -9,12 +9,11 @@ org.springframework.boot spring-boot-starter-parent - 1.0.0.RC1 + 1.2.7.RELEASE com.theotherian.chat.Application - 4.0.1.RELEASE @@ -22,8 +21,8 @@ maven-compiler-plugin - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/src/main/java/com/theotherian/chat/WebSocketConfig.java b/src/main/java/com/theotherian/chat/WebSocketConfig.java index aeb39ff..be253f3 100644 --- a/src/main/java/com/theotherian/chat/WebSocketConfig.java +++ b/src/main/java/com/theotherian/chat/WebSocketConfig.java @@ -5,11 +5,14 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.messaging.converter.MessageConverter; +import org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver; +import org.springframework.messaging.handler.invocation.HandlerMethodReturnValueHandler; import org.springframework.messaging.simp.config.ChannelRegistration; import org.springframework.messaging.simp.config.MessageBrokerRegistry; import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker; import org.springframework.web.socket.config.annotation.StompEndpointRegistry; import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer; +import org.springframework.web.socket.config.annotation.WebSocketTransportRegistration; /** * Set up our websocket configuration, which uses STOMP, and configure our endpoints @@ -47,4 +50,19 @@ public ActiveUserService activeUserService() { return new ActiveUserService(); } + @Override + public void configureWebSocketTransport(WebSocketTransportRegistration arg0) { + // TODO Auto-generated method stub + } + + @Override + public void addArgumentResolvers(List arg0) { + // TODO Auto-generated method stub + } + + @Override + public void addReturnValueHandlers(List arg0) { + // TODO Auto-generated method stub + } + } \ No newline at end of file diff --git a/src/main/resources/static/index.html b/src/main/resources/static/index.html index 82e45f2..1e8e64e 100644 --- a/src/main/resources/static/index.html +++ b/src/main/resources/static/index.html @@ -5,12 +5,20 @@ + +
+
+
+ Please note you need two users logged in to use this application.
+ One user must selec the other shown in the pick list to open the chat windows. +
+