Spring Boot Reactive Programming Webflux map vs flatMap, log and filter Flux

preview_player
Показать описание
What is the difference on the webflux Flux map and flatMap methods?

Enjoy! :-)
Thank you for commenting and asking questions.

The code is located here:
Follow me on twitter:
Support me on Patreon:

As an Amazon Associate I earn from qualifying purchases.
Check out the stuff that I like (always updated):
Рекомендации по теме
Комментарии
Автор

This was really informative. Thank you!

kennethyu-
Автор

Thanks for the video. I am new to reactive programming. Quick Question: As in the example shown the flow of code reaches end of the programme before processing the code in the flatmap, what if we want the code to run the code in flatmap first then reach the end of code and return a particular value which was processed in flatmap?

angelinaoberoi
Автор

map is transform with sync
flatmap is transform with async
right?

mister_tompkin
Автор

Thanks for the video. I am still wrapping my head around the reactive programming paradigm. Quick question:

Way I understand is how your code works is that ".map" is also async and as soon as it returns a single ship, it passes it straight to the ".flatMap" which does its own processing of THAT 1 ship. First .map does not wait for all the ships to be "loaded" before sending them to the next process?

Assuming this simulates a DB call (findById), would you say reactive approach is still preferred if your DB was simply returning 1 ship (Or based on this example - your Flux only had 1 ship? Or would that be an overkill?

Once again, great walkthroughs.

qSwytch