spring-webflux

Listen on changes through spring-webflux and spring reactive data

主宰稳场 提交于 2021-02-20 13:32:20
问题 TL;DR; Is it possible to listen on changes through spring-webflux & spring reactive data ? End of TL;DR; Hi, I did few tutorials regarding new spring webflux module and spring mongo reactive. (correct me If I'm wrong) There are two basic types in reactive spring, Mono (for 0 or single object) and Flux (0 - n) objects. If I return a Flux json object ( a list of all comments) then my client is going to receive them in one response (not in chunks or something). I did it here, I also can change

Split a flux into two fluxes - head and tail

亡梦爱人 提交于 2021-02-19 02:18:37
问题 I want to split a flux into two fluxes where the first one has the first item of the original flux and the second one will takes the rest of items. After applying a custom transformation myLogic on each flux I want to combine them into one flux preserving the order of the original flux. Example: S: student S': student after applying myLogic Emitted flux: s1 -> s2 -> s3 -> s4 The first splited flux: s1' => myLogic The second splited flux: s2' -> s3' -> s4' => myLogic The combined flux: s1' ->

Split a flux into two fluxes - head and tail

社会主义新天地 提交于 2021-02-19 02:18:31
问题 I want to split a flux into two fluxes where the first one has the first item of the original flux and the second one will takes the rest of items. After applying a custom transformation myLogic on each flux I want to combine them into one flux preserving the order of the original flux. Example: S: student S': student after applying myLogic Emitted flux: s1 -> s2 -> s3 -> s4 The first splited flux: s1' => myLogic The second splited flux: s2' -> s3' -> s4' => myLogic The combined flux: s1' ->

Split a flux into two fluxes - head and tail

最后都变了- 提交于 2021-02-19 02:18:17
问题 I want to split a flux into two fluxes where the first one has the first item of the original flux and the second one will takes the rest of items. After applying a custom transformation myLogic on each flux I want to combine them into one flux preserving the order of the original flux. Example: S: student S': student after applying myLogic Emitted flux: s1 -> s2 -> s3 -> s4 The first splited flux: s1' => myLogic The second splited flux: s2' -> s3' -> s4' => myLogic The combined flux: s1' ->

Spring security session timeout for spring reactive

泪湿孤枕 提交于 2021-02-16 22:59:37
问题 I have a Reactive Application with Spring Security integrated, it was created by spring initilizer with mainly thre3 packages(spring boot, spring security and webflux). I was trying to configure the session timeout by following configuration in application.properties : spring.session.timeout=1m after starting the application with mvn spring-boot:run , It can be accessed by http://localhost:8080 and it asked me to login(by default security setting). I can use the username user and the password

Spring Webflux + Grafana : NettyServerCustomizer "This query results in more than 1000000 samples.Try applying more filters or reduce time range.”

纵然是瞬间 提交于 2021-02-11 12:29:29
问题 Small question regarding some metrics exposed in a Spring Webflux 2.4.2 application and the use in Grafana. In my Spring Webflux application, I have the following bean: @Bean public NettyServerCustomizer nettyServerCustomizer() { return httpServer -> httpServer.metrics(true, () -> new MicrometerChannelMetricsRecorder("myservice", "myservice")); } And this bean is doing its job great I would say. It is generating those metrics, among other metrics. m__myservice_data_sent_bytes_sum{remote

Spring Webflux + Grafana : NettyServerCustomizer "This query results in more than 1000000 samples.Try applying more filters or reduce time range.”

谁都会走 提交于 2021-02-11 12:27:16
问题 Small question regarding some metrics exposed in a Spring Webflux 2.4.2 application and the use in Grafana. In my Spring Webflux application, I have the following bean: @Bean public NettyServerCustomizer nettyServerCustomizer() { return httpServer -> httpServer.metrics(true, () -> new MicrometerChannelMetricsRecorder("myservice", "myservice")); } And this bean is doing its job great I would say. It is generating those metrics, among other metrics. m__myservice_data_sent_bytes_sum{remote

Spring Boot 2 - Webflux - Websocket - Activate Compression

被刻印的时光 ゝ 提交于 2021-02-09 07:01:27
问题 I'm using: Spring Boot 2.1.0 Release Webflux (not MVC) Websocket Reactive Netty And I would like to compress the returned payload with "GZIP" (or any other compression). I've tried with the configuration in application.yml: server.compression.enabled: true But the payload returned is still in plain text. Does anybody know how to resolve this? Thanks. 回答1: The server.compression.enabled configuration property is about HTTP response compression, so this won't achieve the desired goal. With

Spring Boot 2 - Webflux - Websocket - Activate Compression

喜夏-厌秋 提交于 2021-02-09 07:00:15
问题 I'm using: Spring Boot 2.1.0 Release Webflux (not MVC) Websocket Reactive Netty And I would like to compress the returned payload with "GZIP" (or any other compression). I've tried with the configuration in application.yml: server.compression.enabled: true But the payload returned is still in plain text. Does anybody know how to resolve this? Thanks. 回答1: The server.compression.enabled configuration property is about HTTP response compression, so this won't achieve the desired goal. With

transform vs transformDeferred

旧城冷巷雨未停 提交于 2021-02-08 10:11:10
问题 What is the difference between transform & transformDeferred in project reactor flux. Good example will be helpful. https://projectreactor.io/docs/core/release/reference/index.html#advanced-mutualizing-operator-usage 回答1: Most of the time, a Flux is "lazy": you declare a processing pipeline, but data only starts flowing once you subscribe to it. You can subscribe multiple times. This is called a cold Flux (and each time you subscribe to a cold source, the source generates its data anew for