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/

310 questions
53
votes
4 answers

Mono vs Flux in Reactive Stream

As per the documentation: Flux is a stream which can emit 0..N elements: Flux fl = Flux.just("a", "b", "c"); Mono is a stream of 0..1 elements: Mono mn = Mono.just("hello"); And as both are the implementations of the Publisher…
KayV
  • 9,560
  • 8
  • 68
  • 111
30
votes
1 answer

In project reactor or akka streams, what is the conceptual difference between sink and subscriber?

The concepts of sink and subscriber seem similar to me. Also, I don't see the concept of sink being explicitly defined in the reactive streams spec.
Jatin
  • 527
  • 6
  • 16
30
votes
6 answers

How to correctly read Flux and convert it to a single inputStream

I'm using WebClient and custom BodyExtractorclass for my spring-boot application WebClient webLCient = WebClient.create(); webClient.get() .uri(url, params) .accept(MediaType.APPLICATION.XML) .exchange() .flatMap(response -> { …
Bk Santiago
  • 1,276
  • 2
  • 13
  • 22
23
votes
1 answer

Using reactor's Flux.buffer to batch work only works for single item

I'm trying to use Flux.buffer() to batch up loads from a database. The use case is that loading records from a DB may be 'bursty', and I'd like to introduce a small buffer to group together loads where possible. My conceptual approach has been to…
Marty Pitt
  • 26,266
  • 34
  • 115
  • 190
22
votes
4 answers

Flutter BLoC pattern - How can I navigate to another screen after a stream event?

My question is about navigation used with the BLoC pattern. In my LoginScreen widget I have a button that adds an event into the EventSink of the bloc. The bloc calls the API and authenticates the user. Where in the LoginScreen Widget do I have to…
Sebastian
  • 2,287
  • 1
  • 13
  • 24
21
votes
1 answer

ParallelFlux vs flatMap() for a Blocking I/O task

I have a Project Reactor chain which includes a blocking task (a network call, we need to wait for response). I'd like to run multiple blocking tasks concurrently. It seems like either ParallelFlux or flatMap() could be used, bare-bone…
Corin Fletcher
  • 1,449
  • 1
  • 14
  • 22
19
votes
1 answer

Akka Streams: What does Mat represents in Source[out, Mat]

In Akka streams what does Mat in Source[Out, Mat] or Sink[In, Mat] represent. When will it actually be used?
Somasundaram Sekar
  • 4,272
  • 5
  • 34
  • 65
17
votes
1 answer

RxJava 2.0 - How to convert Observable to Publisher

How to convert Observable to Publisher in RxJava version 2? In the first version we have the https://github.com/ReactiveX/RxJavaReactiveStreams project that do exactly what I need. But How can I do it in RxJava 2?
15
votes
2 answers

compose() vs. transform() vs. as() vs. map() in Flux and Mono

Recently, I decided to try spring 5 with projectreactor.io (io.projectreactor:3.1.1). Does anyone know what the best case of using this functions? What cons and pros of using each of them and where they should be used? Good examples will be…
15
votes
1 answer

How to properly call Akka HTTP client for multiple (10k - 100k) requests?

I'm trying to write a tool for batch data upload using Akka HTTP 2.0-M2. But I'm facing akka.stream.OverflowStrategy$Fail$BufferOverflowException: Exceeded configured max-open-requests value of [32] error. I tried to isolate a problem and here is…
relgames
  • 1,223
  • 16
  • 32
14
votes
1 answer

Error in graph create: requirement failed: The inlets [] and outlets [] must correspond to the inlets [in] and outlets [out]

I'm using akka streams graphDSL to create a runnable graph. There are no compile-time errors wrt inlet / outlet of the stream components. Runtime throws following error: Any ideas what should I verify to make it run ? requirement failed: The inlets…
phantomastray
  • 449
  • 3
  • 15
14
votes
1 answer

What's the difference between Reactive and Reactive Streams?

I'm trying to understand the difference between Reactive and ReactiveStreams, specifically in the context of RxJava ? The most I could figure out was that Reactive Streams has some notion of backpressure in the specification but that already exists…
Setheron
  • 3,012
  • 3
  • 29
  • 48
12
votes
5 answers

How to send email reactive in spring web-flux

I'd like to stay complete reactive within my new spring application. Therefor I use web-flux/ reactor and ReactiveRepository with MongoDB. Do you know how to integrate java-mail reactively into the tech-stack? Any alternatives?
12
votes
3 answers

publishOn vs subscribeOn in Project Reactor 3

I am using publishOn vs subscribeOn both on the same flux as follows: System.out.println("*********Calling Concurrency************"); List elements = new ArrayList<>(); Flux.just(1, 2, 3, 4) .map(i -> i * 2) .log() …
11
votes
2 answers

Spring Boot Webflux/Netty - Detect closed connection

I've been working with spring-boot 2.0.0.RC1 using the webflux starter (spring-boot-starter-webflux). I created a simple controller that returns a infinite flux. I would like that the Publisher only does its work if there is a client (Subscriber).…
1
2 3
20 21