antonputra / tutorials

DevOps Tutorials
https://youtube.com/antonputra
MIT License
3.2k stars 2.5k forks source link

Add reactive java app version #259

Closed ericsouza closed 2 months ago

ericsouza commented 2 months ago

hey @antonputra , this is my pr of the reactive version of the java app for the lesson 201, which is a comparison between quarkus (java) and golang (fiber). I think I covered most of the blocking part. There is only the AtomicInteger usage, which is indeed thread safe but replacing with UUID can increase perfomance. I do still want to try the vertx Counter which is a properly way to have an atomic counter in a vertx/reactive environment.

for now, I think it can be already used

btw, Is there any problem changing the key of image file from using a counter to use an uuid as follow?

String imgKey = "java-thumbnail-" + UUID.randomUUID() + ".png";
Image img = new Image(imgKey);

thanks for your working with all these benchmarks!!

antonputra commented 2 months ago

Thanks @ericsouza for the PR, let me test it and i'll merge

ericsouza commented 2 months ago

Thanks @ericsouza for the PR, let me test it and i'll merge

Thanks!

If you don't see a big difference, please consider removing the counter used by the upload method and replacing with an uuid string