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

I see that Oleh Dokuka, from Project Reactor (missing disclaimer there), posted an answer already, however much of its assumptions about Akka Streams and Reactive Streams are incorrect, so allow me to clarify below. Disclaimer: I participated in Reactive Streams since it’s early days, and authored most of its Technology Compatibility Kit. I also maintain … Read more

publishOn vs subscribeOn in Project Reactor 3

It took me sometime to understand it, maybe because publishOn is usually explained before subscribeOn, here’s a hopefully more simple layman explanation. subscribeOn means running the initial source emission e.g subscribe(), onSubscribe() and request() on a specified scheduler worker (other thread), and also the same for any subsequent operations like for example onNext/onError/onComplete, map etc … Read more

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

This is really not as complicated as other answers imply. The only way to stream the data without buffering it all in memory is to use a pipe, as @jin-kwon suggested. However, it can be done very simply by using Spring’s BodyExtractors and DataBufferUtils utility classes. Example: private InputStream readAsInputStream(String url) throws IOException { PipedOutputStream … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)