Merge branch '2.1.x'
Closes gh-17079
This commit is contained in:
@@ -48,13 +48,11 @@ public class ChatService {
|
||||
@org.atmosphere.config.service.Message(encoders = JacksonEncoderDecoder.class,
|
||||
decoders = JacksonEncoderDecoder.class)
|
||||
public Message onMessage(Message message) throws IOException {
|
||||
this.logger.info("Author " + message.getAuthor() + " sent message "
|
||||
+ message.getMessage());
|
||||
this.logger.info("Author " + message.getAuthor() + " sent message " + message.getMessage());
|
||||
return message;
|
||||
}
|
||||
|
||||
public static class JacksonEncoderDecoder
|
||||
implements Encoder<Message, String>, Decoder<String, Message> {
|
||||
public static class JacksonEncoderDecoder implements Encoder<Message, String>, Decoder<String, Message> {
|
||||
|
||||
private final ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
|
||||
@@ -50,11 +50,11 @@ public class SampleAtmosphereApplication {
|
||||
// to be mapped to '/chat'
|
||||
AtmosphereServlet atmosphereServlet = new AtmosphereServlet();
|
||||
atmosphereServlet.framework().setHandlersPath("/");
|
||||
ServletRegistrationBean<AtmosphereServlet> registration = new ServletRegistrationBean<>(
|
||||
atmosphereServlet, "/chat/*");
|
||||
ServletRegistrationBean<AtmosphereServlet> registration = new ServletRegistrationBean<>(atmosphereServlet,
|
||||
"/chat/*");
|
||||
registration.addInitParameter("org.atmosphere.cpr.packages", "sample");
|
||||
registration.addInitParameter("org.atmosphere.interceptor.HeartbeatInterceptor"
|
||||
+ ".clientHeartbeatFrequencyInSeconds", "10");
|
||||
registration.addInitParameter(
|
||||
"org.atmosphere.interceptor.HeartbeatInterceptor" + ".clientHeartbeatFrequencyInSeconds", "10");
|
||||
registration.setLoadOnStartup(0);
|
||||
// Need to occur before the EmbeddedAtmosphereInitializer
|
||||
registration.setOrder(Ordered.HIGHEST_PRECEDENCE);
|
||||
|
||||
Reference in New Issue
Block a user