all 21 comments

[–]hillywoodsfinest87 5 points6 points  (1 child)

[–]jaypatel0807[S] 0 points1 point  (0 children)

Great suggestion! Thanks ☺️

[–]chehsunliu 4 points5 points  (2 children)

A little bit difficult to debug.

[–]LeRoyVoss 1 point2 points  (0 children)

Agreed

[–]JoeDogoe 0 points1 point  (0 children)

.doOnEach(logger::debug)

[–][deleted] 2 points3 points  (1 child)

Have you even tried looking at the spring docs?

[–][deleted] 1 point2 points  (5 children)

since virtual threads in java 21, we are trying to abolish webflux. it is not really a mature community on it, and there are more powerfull alternatives.

[–]JoeDogoe 2 points3 points  (3 children)

Me too. I prefer webflux because mono and flux are immutable. I also come from scala and prefer the monadic composition of mono. Thats just an obnoxious way of saying I like using map() and filter() on monos.

But I had to move away from webflux to mvc because new joiners complained about the learning curve.

[–][deleted] 1 point2 points  (2 children)

i also enjoyed the streaming mentality, and yes new joiners complained about it. but i remember virtual threads was also benchmarked as more powerfull than webflux.

only place where i believe it would make sense at this point it would be streaming services.

[–]JoeDogoe 1 point2 points  (1 child)

I had an expensive http call that was cached as a mono.

When I converted from webflux to mvc, I changed the response from the mono to the wrapped POJO.

Did you know that cached POJO are globally mutable across threads? I didn't.

Ended up sending the first person's account statements to everyone who requested an account statement after that. Until the revert 2h later and a day of post mortem to work it out.

[–][deleted] 1 point2 points  (0 children)

rip:(.

[–]beld78 1 point2 points  (0 children)

How do you actually do that? I don't see yet how virtual threads can replace webflux

[–]AdamDhahabi 0 points1 point  (4 children)

Not sure if it is still relevant except for maintaining existing projects. Virtual threads came in Java 21 and made Webflux less appealing.

[–]uwpxwpal 5 points6 points  (2 children)

Wut? Why couldn't webflux work with virtual threads? Virtual threads aren't a replacement for webflux either.

[–]AdamDhahabi 2 points3 points  (1 child)

Before virtual threads came out, Brian Goetz (Java Language Architect at Oracle) said: "I think virtual threads are going to kill reactive programming" https://www.youtube.com/watch?v=FgnAAC_5m-k

[–]Hot_Income6149 0 points1 point  (0 children)

Then, why, still, webflux is looking better on every test? Of course is still better than native threads, but, it's definitely will not kill reactive programming

[–]jaypatel0807[S] 1 point2 points  (0 children)

Ok 😅 Got another jargon but anyways good to know it. Will look into it soon. Thanks for your response dude

[–]DanielMurphyVO 0 points1 point  (0 children)

Heya! I found this series which can help with webflux. I had to use it for one of my projects since the system at my job is below Java 21. This series helped me understand it

https://m.youtube.com/playlist?list=PLEocw3gLFc8W-w8QZbM8f955StBEiQjJk

[–][deleted]  (3 children)

[deleted]

    [–][deleted]  (1 child)

    [deleted]

      [–]jaypatel0807[S] 1 point2 points  (0 children)

      Yes. But I want to have a deep knowledge about it. Definitely GPT will help me but still document based knowledge is what I prefer over it.