Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Reactive Streams in Java : Drawbacks

 
Greenhorn
Posts: 12
2
Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

Reactive programming is popular. Since Java 8, functional programming style is really loved, especially streams. This topic is attractive.

But everything has drawbacks. When shouldn't we use reactive streams?

Thanks in advance,
Ayşenur.
 
Author
Posts: 16
5
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good question.

The drawbacks are in overhead and complication. For example, Exception stack traces will become very large and confusing.

You should not use reactive streams for any application that already works well without it. For example do not use it for something that is single threaded and does make a lot of blocking method calls. Also don't use it if using a ExecutorService would work just as well. https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutorService.html

It works well for complex, high traffic, multi-threaded applications with a mix of computation and blocking calls that need close to real-time latency and response times.
 
Story like this gets better after being told a few times. Or maybe it's just a tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic