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

CancellationException occurs while subscribing to connectable hot source

I am using reactor-core 3.1.4. Consider the following code snippet: Flux flux = Flux.create(sink -> sink.next("test")) .replay(1) .refCount(); flux.subscribe(System.out::println); flux.next().subscribe(System.out::println);…
2
votes
1 answer

Reactor's Flux.combineLatest() with Flux and Mono

Could someone explain me why does it behave this way? Flux.combineLatest( Tuples::fromArray, Flux.just(1, 2, 3), Mono.just("x")) .collectList() .block(); // [{3, "x"}] Flux.combineLatest( Tuples::fromArray, Mono.just("x"), …
2
votes
1 answer

How to combine publishers by pairing values from two Flux into a Tuple?

Say i have two Flux as follows: Flux f1 = Flux.just(10,20,30,40); Flux f2 = Flux.just(100,200,300,400); Now what i want is to combine these flux into a single Flux or a Tuple of both the Flux, which will be having the…
KayV
  • 12,987
  • 11
  • 98
  • 148
2
votes
1 answer

Why is Subscriber requesting different number of elements in different cases?

I am learning reactive streams and publish-subcribe utility and i am using the default behaviour of Publisher(Flux in my case) and Subscriber. I have two scenarios, both having the same number of elements in Flux. But when i analyse the logs, the…
KayV
  • 12,987
  • 11
  • 98
  • 148
2
votes
0 answers

Is it possible to use Publisher created using Java 9 Reactive Stream in Spring WebFlux BodyInserters?

I am learning reactive programming using Reactive Streams in Java 9 and also using org.reactivestreams in spring 5. And i am creating a WebClient using the webflux api spring 5 and spring boot2. Now, when we set the body of a request using…
KayV
  • 12,987
  • 11
  • 98
  • 148
2
votes
1 answer

Can a Subscriber act as a Publisher?

In terms of Reactive Streams, there is a Publisher and it could have as many Subscribers. But suppose, a subscriber gets a message from Publisher. Now this Subscriber(say Subs1) changes/modifies the message and passes it to some other Subscriber(say…
KayV
  • 12,987
  • 11
  • 98
  • 148
2
votes
1 answer

How is HTTP protocol used to implement sending of asynchronous streams of data from HTTP server to client?

How do popular HTTP servers or frameworks use HTTP protocol to implement asynchronous streams of data from HTTP server to HTTP client? (client could be browser or non-browser) [client] ----request for data----> [server] [client]…
Jatin
  • 667
  • 8
  • 16
2
votes
1 answer

Akka streams reduce to smaller stream

I have an ordered stream of data A A A B B C C C C ... (very long) And I want to transform it to a stream of aggregates in the form (item, count): (A, 3) (B, 2) (C, 4) What operators could I use in Akka Streams for…
Andrejs
  • 26,885
  • 12
  • 107
  • 96
2
votes
1 answer

Why does an Akka stream has exactly one source and sink?

Akka Streams docs clearly state that in order for a stream to be runnable it must have exactly one source and exactly one sink. I wonder what imposes such constraint. Scenarios with multiple sources merged into one multiple sinks forked from a…
Vagif Abilov
  • 9,835
  • 8
  • 55
  • 100
2
votes
1 answer

Akka streams and transaction boundaries

I am still grasping Akka stream concepts and trying to understand how to map them to scenarios when we have a collection of items that need to be processed in atomic way. Let's say we have a purchase order that consists of multiple items and we need…
Vagif Abilov
  • 9,835
  • 8
  • 55
  • 100
2
votes
1 answer

cyclops-react and async-retry: How to retry on timeout?

I'm starting to use cyclops-react with async-retry. I'm still a little bit lost with it. I'm using SimpleReact and simulating a timeout from the server but I never receive a timeout with something like this: private List executeParallel() { …
Jorge
  • 184
  • 1
  • 8
2
votes
0 answers

Akka Streams fails with NPE using twitter4j-stream

I'm experimenting with Akka streams and twitter4j-stream. Having a stream of tweets it works fine until the moment when it fails with NPE, which doesn't make sense to me. Initially i'm creating a client: val client: TwitterStream = { …
4lex1v
  • 21,367
  • 6
  • 52
  • 86
2
votes
1 answer

How to run a RunnableGraph in Akka Streams 2.4.2 and ensure inlets/outlets are configured correctly?

I've configured a RunnableGraph using GraphDSL.create(). I've also specified a ClosedShape and connected all outlets/inlets. When I try to execute the program I get the following runtime exception: requirement failed: The inlets [] and outlets []…
Kevin Webber
  • 125
  • 8
2
votes
1 answer

what is the relationship about reactive-ipc, reactive stream io, reactive stream net and reactivesocket

I found many repos in Github about reactive stream,seems there are similar. However, many repos are not updated several months. I want to know the relationship about them and i can focus on the latest…
GrapeBaBa
  • 1,391
  • 3
  • 12
  • 22
2
votes
2 answers

Scala Akka Stream: How to Pass Through a Seq

I'm trying to wrap some blocking calls in Future.The return type is Seq[User] where User is a case class. The following just wouldn't compile with complaints of various overloaded versions being present. Any suggestions? I tried almost all the…
Abhijit Sarkar
  • 21,927
  • 20
  • 110
  • 219