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
1
vote
0 answers

How to Create an org.reactivestreams.Publisher from a java.io.InputStream?

How can an org.reactivestreams.Publisher be created from a java.io.InputStream? Context: I am using the awssdk to create an AsyncRequestBody, I have an InputStream and am therefore trying to use the AsyncRequestBody.fromPublisher method…
Ramón J Romero y Vigil
  • 17,373
  • 7
  • 77
  • 125
1
vote
1 answer

Is reusing project reactor publisher Flux/Mono considered a best practice?

Project Reactor publisher Flux/Mono are reusable. We can subscribe multiple time to the same publisher. By doing that we avoid useless object creation but i feel like it make the code harder to read in some case. Is there specific argument that…
1
vote
1 answer

How to set up several different WebFlux client properties for the different Apache Camel routes?

In the route set up we have a call for WebClient.build() being set up before the route is declared: @Override public void configure() { createSubscription(activeProfile.equalsIgnoreCase("RESTART")); …
Eljah
  • 4,188
  • 4
  • 41
  • 85
1
vote
1 answer

Apache Camel reactive streams with Bindy - only reading first line

I'm trying to use Apache Camel (version 2.25.3) reactive streams in combination with Spring Boot to read a large csv file and unmarshal the lines using Bindy. This is "working" in the sense that the application runs and detects files as they appear…
1
vote
0 answers

Reactive web services and backpressure

I'm studying reactive streams concepts. I understand it's non-blocking processing of demand-driven, push-based data streams. The central concept is backpressure, which means the consumer controls the flow of data from upstream producer. How is the…
1
vote
1 answer

MongoDb Java driver reactive with POJO mapping find List of documents in a type safe way

I have a bunch of Document in a Collection and would like to retrieve all of them. This is my situation: I am using the Java Reactive Streams driver I am using the CodecRegistry to get my Document deserialized to my Pojo The problem is that all…
Shankha057
  • 1,296
  • 1
  • 20
  • 38
1
vote
1 answer

How do I add autoincrementing ids to a dynamically sized observable array?

I'm using callbags, but the logic is the same as with RxJS. I'm making an observable list that can be added to and removed from. I want to have autoincrementing ids. I don't know the correct logic to attach the ids to the items. Here's a simplified…
Eva
  • 4,397
  • 5
  • 43
  • 65
1
vote
1 answer

how to handle browser close case (action/event) on RxJava2 Flowable with SSE (Server-Sent-Events)

I want to get notified if the consumer close the browser or somehow disconnects from SSE stream. as an example when connection start with curl, the doOnSubscribe operation is called and the connectedDeliveryCount is getting increased but never…
1
vote
0 answers

Emit a new item if there is a gap since the previous item in the stream

I have a stream of outgoing messages. They can occur at arbitrary intervals. If there is no message for a period after the last message was sent, I'd like to emit a new message which acts as a keep-alive or heartbeat. Here's a code example of what…
Michael
  • 41,989
  • 11
  • 82
  • 128
1
vote
1 answer

Flow> instead of using Flow?

I've noticed that many people and examples Use Flows as a Wrapper around List<>, For example like this: @Query("SELECT * from some_model ORDER BY some_field") fun getData(): Flow> As I know the Flow is like kind of "asynchronous…
MR3YY
  • 638
  • 1
  • 8
  • 18
1
vote
0 answers

Unable to create text index in java reactive streams mongodb driver

I am trying to apply text indexing in description and name field. I am unable to create the index using the following method. Can somebody help to find the issue with the following piece of code. import…
Soma Kundu
  • 33
  • 5
1
vote
0 answers

Reactor - Change flatMap Concurrency Dynamically

Is it possible to change the Reactor Flux flatMap concurrency during runtime? The flatMap API allows us to configure the concurrency during the assembly time. I am using flatMap to subscribe to a WebClient, the WebClient does a GET of REST call to…
1
vote
2 answers

Reactor Flux flatMap operator throughput/concurrency control and achieve backpressure

I am using Flux to build my reactive pipeline. In the pipeline, I need to call 3 different external system REST APIs, which are very strict with their Rate of access. I will be throttled exponentially if i breach the rate-per-sec threshold. Each…
1
vote
1 answer

How to combine/chain multiple Mono/Flux containing different datatypes without nested subscriptions

We are using project-reactor to retrieve some data from an external webservice and generate a bunch of resulting objects. First we need to fetch some masterdata that is needed to trigger the next webservice calls. After the masterdata is available…
1
vote
0 answers

Limit subscription concurrency in Reactor

I have an utility class centralizing Reactor's Publishers to deal with Cassandra queries: public Mono execute(Statement statement) { return Mono.defer(() -> Mono.fromFuture(FutureConverter …
GlinesMome
  • 1,549
  • 1
  • 22
  • 35