File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
src/main/java/com/github/rawsanj/handler Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 99import org .springframework .http .MediaType ;
1010import org .springframework .web .reactive .function .server .RouterFunction ;
1111import org .springframework .web .reactive .function .server .ServerResponse ;
12+ import reactor .core .scheduler .Schedulers ;
1213
1314import static org .springframework .web .reactive .function .server .RequestPredicates .GET ;
1415import static org .springframework .web .reactive .function .server .RequestPredicates .POST ;
@@ -23,7 +24,9 @@ public RouterFunction<ServerResponse> htmlRouter(@Value("classpath:/static/index
2324 return route (GET ("/" ), request -> ok ().contentType (MediaType .TEXT_HTML ).bodyValue (html ))
2425 .andRoute (POST ("/message" ), request -> request .bodyToMono (Message .class )
2526 .flatMap (message -> redisChatMessagePublisher .publishChatMessage (message .getMessage ()))
26- .flatMap (aLong -> ServerResponse .ok ().bodyValue (new Message ("Message Sent Successfully!." ))));
27+ .flatMap (aLong -> ServerResponse .ok ().bodyValue (new Message ("Message Sent Successfully!." )))
28+ .subscribeOn (Schedulers .boundedElastic ()));
29+
2730 }
2831
2932}
You can’t perform that action at this time.
0 commit comments