AWS S3 with Reactive Spring and Web-flux

Sugavaneshwar S
Dev Time
Published in
2 min readAug 29, 2020

--

Asynchronous Programming — also known as hell.

Editor: Vimalsudhakar, Naveen Kumar M N

After a countless nights of googling, staring at AWS java SDK docs finally found a way to implement asynchronous spring boot application using reactive spring and web-flux.

Photo by Thomas Bishop on Unsplash

Usually I follow imperative(Synchronous and Blocking) style of coding which makes me a weird psychopath - who gets easily frustrated whenever request exceeded the thread pool size. Ohhh God!! 😱 then when I increase thread pool size then it makes memory inefficient. I need to use low thread pool size to consume low memory and to process with high efficient. (To save money obviously 😢)

Eureka😃!!!!!! found a solution which will follow asynchronous and non-blocking style using “Reactive Spring and web-flux”. This style also used to reduce the back pressure and time for response cause the memory for the objects are pre-baked. Let’s try this style with basic example which uses AWS S3 service.

Lets get into pom.xml

Add dependencies for project reactor and amazon SDK for S3.

--

--