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 9
9
import org .springframework .http .MediaType ;
10
10
import org .springframework .web .reactive .function .server .RouterFunction ;
11
11
import org .springframework .web .reactive .function .server .ServerResponse ;
12
+ import reactor .core .scheduler .Schedulers ;
12
13
13
14
import static org .springframework .web .reactive .function .server .RequestPredicates .GET ;
14
15
import static org .springframework .web .reactive .function .server .RequestPredicates .POST ;
@@ -23,7 +24,9 @@ public RouterFunction<ServerResponse> htmlRouter(@Value("classpath:/static/index
23
24
return route (GET ("/" ), request -> ok ().contentType (MediaType .TEXT_HTML ).bodyValue (html ))
24
25
.andRoute (POST ("/message" ), request -> request .bodyToMono (Message .class )
25
26
.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
+
27
30
}
28
31
29
32
}
You can’t perform that action at this time.
0 commit comments