Questions tagged [reactive-streams]

a standard for asynchronous stream processing with non-blocking back pressure on the JVM

Reactive Streams is an initiative to provide a standard for asynchronous stream processing with non-blocking back pressure on the JVM.

http://www.reactive-streams.org/

358 questions
2
votes
1 answer

Deep "flatReduce" for WebFlux?

I have defined an operator flatReduce() which is to reduce() what flatMap() is to map(): public class FlatReduce { public static Mono flatReduce(Mono initial, Iterable items, BiFunction> accumulator) { for…
2
votes
2 answers

Reading from a Flux in chunks

Is it possible do read from a webflux flux in chunks? ( other than using delayElements ) For example after I write Flux.range(1, 10).doOnNext(System.out::println).take(5).subscribe(); is there any way to continue to read the next 5 integers? If…
Gonen I
  • 5,576
  • 1
  • 29
  • 60
2
votes
0 answers

Spring Project Reactor for Kinesis

I have a micro service that consumes data from Kinesis stream , I want to convert it into reactive stream consumer since application is already written using spring-boot 2.x. I was going through support of Project Rector for Kinesis and found few…
2
votes
1 answer

Change Stream Duplication if Microservices instance got replicated

I have implemented MongoDB Change Stream in a Java Microservice, When i do a replica of my Microservice I See change stream watch is listening twice. Code is duplicated. Any way to stop this?
Sayeed
  • 39
  • 1
  • 4
2
votes
1 answer

LiveDataReactiveStreams: How to handle errors while using fromPublisher()

I am trying to convert a "Flowable" to "LiveData" using Reactive Streams. Looked up a bunch of articles but I still haven't grasped the concept of handling error states. Currently, I am in the beginning phases of learning RxJava. It would be really…
Mridul
  • 23
  • 7
2
votes
1 answer

Spring Integration | Reactive Streams Support | Exception in creating a reactive Message Gateway

I am trying to upgrade the spring integration flow in one of my existing application with Reactive Streams Support. The approach taken is to change the parameter and return type of the Gateway method as Mono. The flow executes smoothly and when the…
garuna
  • 21
  • 2
2
votes
2 answers

How to limit thread pool size in MongoDB async driver

According to JAVA-2561, it is possible to limit the number of threads created by the MongoDB async driver since release 3.6. However, I couldn’t find any documentation about how to do it.
Étienne Miret
  • 6,448
  • 5
  • 24
  • 36
2
votes
1 answer

Project Reactor: Enriching the result of a Flux with the result of a Mono

I am working to introduce reactive programming to my company. I'm in the process of building a simple demo of an activity recommendation system to prove the performance benefits. One of the challenges I have come up against is enriching the results…
Carl
  • 548
  • 1
  • 4
  • 21
2
votes
1 answer

Subscriber instances in mongodb reactive streams

I have come across mongodb reactive streams drivers and they seem to be pretty good for asynchronous operations. Also, for every operation we do, we need to specify a subscriber for that. My query is whether we should create a different subscriber…
2
votes
1 answer

How to update field type in a document using Java MongoDB Reactive driver?

I have a document in MongoDB collection: { "fOne": "strValue", "fTwo": { "nestedFArray": [ { "dateF": "2010-01-02T13:00:01" }, { "dateF": "2010-01-02T13:00:01" } ], …
jonua
  • 1,915
  • 3
  • 17
  • 27
2
votes
1 answer

How can I get last item of Flux without collapsing it with reduce() or last()

How can I get last item of Flux without collapsing it with reduce() or last() ? Here is my use-case: 1) I have generator that produces Flux based on state. 2) When inner Flux completes it alters the state that affect next Flux objects I emit in…
expert
  • 29,290
  • 30
  • 110
  • 214
2
votes
1 answer

Reactive Streams TCK (Technology Compatibility Kit) test on simple application stalls/slows will not run

Question: Need help successfully running test from Reactive Streams TCK (Technology Compatibility Kit)? SimplePublisher.java (example) package aaa.bbb.ccc.jar; import java.util.Iterator; import java.util.stream.IntStream; import…
sairn
  • 461
  • 3
  • 24
  • 58
2
votes
1 answer

Project Reactor: Designing a reactive API

I have a map function which defined as follows: Mono map(IN in) Here's a concrete example: public Mono map(String s) { return Mono.fromCallable(() -> { try { Thread.sleep(1_000); //…
IsaacLevon
  • 2,260
  • 4
  • 41
  • 83
2
votes
1 answer

Project Reactor: How to control Flux emission

I have a flux that emits some Date. This Date is mapped to 1024 simulated HTTP requests that I'm running on some Executer. What I'd like to do is waiting for all the 1024 HTTP requests before emitting the next Date. Currently when running, onNext()…
IsaacLevon
  • 2,260
  • 4
  • 41
  • 83
2
votes
1 answer

Project Reactor: Multiple Publishers making HTTP calls and one Subscriber to handle all results

The problem with the following code is that the subscriber sees only items of the first flux (i.e. only printing 1). Interestingly, if I add delayElements, it works fine. This is a toy example, but my intention is to replace it with Flux's that make…