Spring Boot WebFlux | Spring Data Reactive MongoDB -CRUD Example | JavaTechie

  Рет қаралды 42,181

Java Techie

Java Techie

Күн бұрын

Пікірлер: 100
@mahimakaushal7381
@mahimakaushal7381 2 жыл бұрын
very very nice video everything was so clear reactive was new for me but this video cleared everything.
@HallOfMemeYT
@HallOfMemeYT 3 жыл бұрын
no tutorial can be better than this.i used traditonal mysql database with the reactive rest service..Thnx for the tutorial
@Javatechie
@Javatechie 3 жыл бұрын
Thanks buddy . If you want to use traditional MySQL DB then please go with R2DBC
@vengateshm2122
@vengateshm2122 3 жыл бұрын
Well said
@javatutorialshub8896
@javatutorialshub8896 3 жыл бұрын
You are explaining very easy way. keep growing. 👍 👍
@gabrielgitonga1252
@gabrielgitonga1252 3 жыл бұрын
Awesome, this is awesome. I love the way you teach. Always following you.
@Javatechie
@Javatechie 3 жыл бұрын
Thanks Gabriel ,👍
@gabrielgitonga1252
@gabrielgitonga1252 3 жыл бұрын
@@Javatechie You are welcome.
@sreesri8492
@sreesri8492 3 жыл бұрын
Your videos are very easy to understand, even for freshers. I always advice my frd to watch your videos. Thank you
@samuelsodagudi
@samuelsodagudi 3 жыл бұрын
Thank you soo much for making this video. 🙏🙏🙏
@PavelQuezada
@PavelQuezada 3 жыл бұрын
nice tutorial, thank you soo much, greetings from Perú
@amitkumar7566
@amitkumar7566 3 жыл бұрын
Very clear. Waiting for your video on SAGA pattern of microservices.
@michaeldeng1981
@michaeldeng1981 3 жыл бұрын
Great. Only thing want to point out is the controller class path is not fully restful, should follow the rest urls conventions. For example, no need to write "update" in the url.
@Javatechie
@Javatechie 3 жыл бұрын
Thanks but once I defined root url as /products then do you really need to define /product again ?
@michaeldeng1981
@michaeldeng1981 3 жыл бұрын
@@Javatechie /products should be fine.
@mayanksharmaisrolling
@mayanksharmaisrolling 3 жыл бұрын
Hi nice video, do you see any performance improvement while using reactive programming ? I mean in this example although you are using reactive programming , the responses are not streamed(as you did in the previous tutorial). so what benefit you see for using reactive for this use case vs traditional rest and non reactive programming?
@edgarfranklizarragaugarte1191
@edgarfranklizarragaugarte1191 3 жыл бұрын
same question here... I used APPLICATION_STREAM_JSON_VALUE to produce it an it works but it is deprecated
@rajkumardas8776
@rajkumardas8776 2 жыл бұрын
same question from my side as well.
@rajkumardas8776
@rajkumardas8776 2 жыл бұрын
I know the answer now! By default browser donesn't understand that this is a stream API so you are not seering the streaming behavior though it is in really. You need to include the produces as APPLICATION_JSON_STREAM_VALUE if you want to see the behavior in browser. In practical, we don't need that becuase the call happens in services only.
@AzizSugianto28
@AzizSugianto28 4 ай бұрын
Hi, That's a great explanation. I need clarification regarding the non-blocking nature of reactive MongoDB. Let's say we have the getProducts endpoint already hit and the browser is still open, then we hit the saveProduct endpoint, will the new data loaded asynchronously on the previously opened browser?
@raghuvardhansaripalli9636
@raghuvardhansaripalli9636 3 жыл бұрын
Hi Basanth, if you have time, could you please do a complete spring cloud gateway with resilence4j, load balancing, security, authentication, routing, filters using 2 Microservices..thank you in advance..stay safe..🙏❤️
@shivaniKadali
@shivaniKadali 6 ай бұрын
we are created the Entity. then what is the use of create DTO with same fields? and another question is i am trying to postmapping it gives responce as 200 but its not saving to DB , rest of the endpoints are working properly
@diggusbickus
@diggusbickus Жыл бұрын
Genius, thank you.
@hanumanthram6754
@hanumanthram6754 3 ай бұрын
Can we also use JpaRepository? or any alternative class is available
@edgarfranklizarragaugarte1191
@edgarfranklizarragaugarte1191 3 жыл бұрын
is the JSON that returns to the client(browser) blocking others requests? I raised this question since you used TEXT_EVENT_STREAM_VALUE to provide values...
@Javatechie
@Javatechie 3 жыл бұрын
No it won't Block it keep publish stream to the client
@fipabrate
@fipabrate 7 ай бұрын
I had the same question
@swapniloo7_
@swapniloo7_ Ай бұрын
You can use mapstruct mapper for entity to DTO and DTO to entity conversion.... No need to write boiler plate code
@josephjesusflorianflores7089
@josephjesusflorianflores7089 3 жыл бұрын
hi, how would he use the saveAll method that saves several documents but not DTOS?
@Javatechie
@Javatechie 3 жыл бұрын
For several documents you must need to create multiple repository .so each repo have their save all method
@elizeuramos2371
@elizeuramos2371 2 жыл бұрын
thanks so much, very very nice video
@ogabeksaidov1986
@ogabeksaidov1986 3 жыл бұрын
Simple GREAT👍
@sushilmadankar53
@sushilmadankar53 3 жыл бұрын
HI...How that findByPriceBetween is being executed? I meant where is its implementation code?..How it returns data exactly between those price ranges...some miracle is it?? please reply asap.Thank you in advance. Also, suggest where I can get familiar with these type of reactive coding
@Javatechie
@Javatechie 3 жыл бұрын
This is inbuilt code of spring data jpa and it's syntax
@sushilmadankar53
@sushilmadankar53 3 жыл бұрын
@@Javatechie Okay..but how that code knows I have to pick price field values, could you please suggest any link for reference??
@Javatechie
@Javatechie 3 жыл бұрын
Can you please check my spring data jpa tutorial
@sushilmadankar53
@sushilmadankar53 3 жыл бұрын
@@Javatechie please reply with the exact link of video, there are so many
@kwadwodwomoii8916
@kwadwodwomoii8916 Жыл бұрын
It's auto-implemented by Spring Data. It's the same for the other annotations.
@vemulavamsikoundinya
@vemulavamsikoundinya Жыл бұрын
Hi Basanth, you are doing great job. How to work with entity mapping with ReactiveCrudRepositoy, isit same as JPARepository?
@Javatechie
@Javatechie Жыл бұрын
Yes same only it will differ with return type like mono and flux other than that not much difference
@vemulavamsikoundinya
@vemulavamsikoundinya Жыл бұрын
Hi Basant, if possible could you please provide example on mapping with ReactiveCrudRepositoy.
@Javatechie
@Javatechie Жыл бұрын
Okay i will
@AshishYadav-se4db
@AshishYadav-se4db 3 жыл бұрын
Thank you so much sir.
@ShauryaChawlaprayforplagues
@ShauryaChawlaprayforplagues 2 жыл бұрын
Hey thanks for this tutorial! I made a mini app with a Thymeleaf form to input data. When I call the save method, the data is not saved. But when I add a .subscribe() method after the actual repo insert(), it saves. I don't see you using the subscribe() method. What am I missing here? Please help!
@Born_2_Reflect
@Born_2_Reflect 3 жыл бұрын
please provide the link for using Mongo DB using Docker Compose and integrate testing webclient for webflux ?
@vinayakkajagar188
@vinayakkajagar188 2 жыл бұрын
Hi @JAVA_techie can you ans me , even if we don't send any body in put method means without json if we hit put api to update , it's saying 200 ok as response code , can you please explain what might be reason
@Javatechie
@Javatechie 2 жыл бұрын
It should give bad request error 405
@vinayakkajagar188
@vinayakkajagar188 2 жыл бұрын
@@Javatechie but its not giving me bad request , it's responding with 200 ok
@vinayakkajagar188
@vinayakkajagar188 2 жыл бұрын
It's depends on router function , is it?
@Javatechie
@Javatechie 2 жыл бұрын
Let me check if that is the case then we didn't implement properly
@vinayakkajagar188
@vinayakkajagar188 2 жыл бұрын
@@Javatechie ok
@bharatbhaisolanki3081
@bharatbhaisolanki3081 2 жыл бұрын
Reactive Repositories are not supported by JPA. Offending repository with mysql - @Query("from Product where price between ?1 and ?2 ")
@Javatechie
@Javatechie 2 жыл бұрын
Not sure about current version
@prateeknima3388
@prateeknima3388 2 жыл бұрын
Hi Basant, Thanks for the video. I have tried creating a sample application but I get the socket connection error [localhost:27017] org.mongodb.driver.cluster: Exception in monitor thread while connecting to server localhost:27017 com.mongodb.MongoSocketOpenException: Exception opening socket Do you have any idea regarding this?
@Javatechie
@Javatechie 2 жыл бұрын
Check whether your mong server is up and running or not?
@prateeknima3388
@prateeknima3388 2 жыл бұрын
@@Javatechie Thank you for your reply. I was trying to utilize only the embedded repository so was wondering if spring would do the installation of embedded mongoDB?
@bikashpatra119
@bikashpatra119 10 ай бұрын
@@prateeknima3388 For embedded mongodb to work, you need to do the following changes in your application configuration Please note, I am using Spring 3.2.2. 1) Use the following dependency for embedded mongo in your pom.xml de.flapdoodle.embed de.flapdoodle.embed.mongo.spring3x 4.12.2 2. The flapdoodle would need the mongo version that it can bring up. We need to provide the mongo version in application.properties. de.flapdoodle.mongodb.embedded.version=7.0.0
@bikashpatra119
@bikashpatra119 10 ай бұрын
@@prateeknima3388 Seems someone deleted by reply here. Let me put it again. I am using spring 3.2.2 on mac In pom.xml you will have to use the below dependency de.flapdoodle.embed de.flapdoodle.embed.mongo.spring3x 4.12.2 In application.properties, we will have to provide version of mongodb de.flapdoodle.mongodb.embedded.version=7.0.0 Both these changes are needed to enable spring to start embedded mongo in your spring boot application.
@thefaizanakhtar
@thefaizanakhtar 3 жыл бұрын
If we are returning content type application/octane stream file in return from server to client using web client what return we should give in bodytoflux()
@karismachoudhury222
@karismachoudhury222 2 жыл бұрын
Thanks for the nice video
@bryanseros
@bryanseros 2 жыл бұрын
Thanks!!! for you help
@ainigma100
@ainigma100 3 жыл бұрын
Great job!!! Thank you for your video! I just have one question. Maybe it is a better (safer) approach to use a constructor-based injection. What do you think?
@Javatechie
@Javatechie 3 жыл бұрын
I am directly using annotation approach
@javabites
@javabites 3 жыл бұрын
In general, constructor based annotation is for mandatory dependencies. Setter Injection is used for optional dependencies.
@ainigma100
@ainigma100 3 жыл бұрын
@@javabites Thank you!!!
@vinodhreddy6227
@vinodhreddy6227 3 жыл бұрын
How we can exstract mono to pojo ans flux to list of pojo?
@avinashavi3718
@avinashavi3718 3 жыл бұрын
Hi Sir, i have some douts, how can i contact you. is there any package,course, like that
@Javatechie
@Javatechie 3 жыл бұрын
javatechie4u@gmail.com
@ARPITGUPTA-sx1hr
@ARPITGUPTA-sx1hr 2 жыл бұрын
Hi when i try to run the application It is showing error: cannot find symbol .doOnNext(e->e.setId(id))) ^ symbol: method setId(java.lang.String) location: variable e of type com.example.demo.entity.Product Could you please tell me how to resolve this ??
@khemchandkolhe3
@khemchandkolhe3 3 жыл бұрын
great tutorial
@severessnape9821
@severessnape9821 3 жыл бұрын
Nice video, but I don't understand why you took entity and dto separately (and performing conversion operations separately in utils) ? Is that a convention or something? Can we not use Entity directly?
@Javatechie
@Javatechie 3 жыл бұрын
No this is the recommended industry standard you shouldn't use Entity directly
@manikantatikkisetty3594
@manikantatikkisetty3594 Жыл бұрын
I do have same question. What is the difference between both.
@krishind99
@krishind99 2 жыл бұрын
Great work. Thanks for putting this together. How do you do error handling in each stamp. What happens if insert or update fails. What if, ID you are looking for is not found?
@itscaesar.794
@itscaesar.794 Жыл бұрын
Hi, I am getting the following error :- java.lang.NullPointerException: null at java.base/java.util.Objects.requireNonNull(Objects.java:208) ~[na:na] Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: Error has been observed at the following site(s): *__checkpoint ? HTTP POST "/games" [ExceptionHandlingWebHandler] Original Stack Trace: at java.base/java.util.Objects.requireNonNull(Objects.java:208) ~[na:na] at com.SpringWebFluxExample.service.gameService.saveGames(gameService.java:27) ~[main/:na] at com.SpringWebFluxExample.controller.gameController.saveGame(gameController.java:30) ~[main/:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na] at org.springframework.web.reactive.result.method.InvocableHandlerMethod.lambda$invoke$0 Can you please help me out with this.
@Javatechie
@Javatechie Жыл бұрын
Please debug and check
@itscaesar.794
@itscaesar.794 Жыл бұрын
@Java Techie Yes, done that. It turns out that the project structure was the culprit here. Thanks for the tutorial 👍
@johncerpa3782
@johncerpa3782 3 жыл бұрын
Great video!
@musa4747
@musa4747 3 жыл бұрын
Thank you brother
@prileepmathan8144
@prileepmathan8144 3 жыл бұрын
Can you add videos about Spring Reactive R2DBC with Oracle Database?
@Javatechie
@Javatechie 3 жыл бұрын
Yes I will add buddy
@tamizhvananasaithami5021
@tamizhvananasaithami5021 3 жыл бұрын
thanks for your material looks pretty simple and easy understandable. need your input the below example
@pratishrutipanda6461
@pratishrutipanda6461 3 жыл бұрын
Nice video sir
@rajkumardas8776
@rajkumardas8776 2 жыл бұрын
Can you please give your answer on Mayank's question below please?
@rajkumardas8776
@rajkumardas8776 2 жыл бұрын
I know the answer now! By default browser donesn't understand that this is a stream API so you are not seering the streaming behavior though it is in really. You need to include the produces as APPLICATION_JSON_STREAM_VALUE if you want to see the behavior in browser. In practical, we don't need that becuase the call happens in services only.
@ajinkyarawankar3245
@ajinkyarawankar3245 3 жыл бұрын
Can you make video on how to save and retrieve nested objects. Saving nested objects separately and build the complete object while retrieving parent object.
@jaganreddy17
@jaganreddy17 2 жыл бұрын
Can you do Video on Spring webflux with reactive rabbitmq?
@tamizhvananasaithami5021
@tamizhvananasaithami5021 3 жыл бұрын
Spring Data Reactive MongoDB -CRUD Example for one to many or many to many examples relation . can you give some inputs
@chiragmatta9171
@chiragmatta9171 3 жыл бұрын
Can you please make tutorial on reactive programing with Kafka and ActiveMQ
@SivaKumar-gl9ty
@SivaKumar-gl9ty 3 жыл бұрын
Thanks!!..
@reddy8870
@reddy8870 3 жыл бұрын
Great, how to convert Mono to List ? Without using block()
@debasismaharana2314
@debasismaharana2314 3 жыл бұрын
We need mongo db vedio. Please make one .
@Javatechie
@Javatechie 3 жыл бұрын
Please check in my spring boot playlist it's already there kzbin.info/www/bejne/oWazlqytmMeJj8U
@nhatvu868
@nhatvu868 3 жыл бұрын
Thank you for those videos; they helped me a lot. But now I am struggling to solve my task which is: how to make the browser displays new document along with the old ones every time I insert a new document into my MongoDB, without refreshing my browser. Any solutions or keywords will help, thank you.
@Javatechie
@Javatechie 3 жыл бұрын
You need to use SSE (Server Sent Event) concept
@nhatvu868
@nhatvu868 3 жыл бұрын
@@Javatechie Thank you so much, I will check that out now
@subramanianchenniappan4059
@subramanianchenniappan4059 3 жыл бұрын
Thanks
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 158 МЛН
REAL or FAKE? #beatbox #tiktok
01:03
BeatboxJCOP
Рет қаралды 18 МЛН
Java Virtual Threads - Reactive Programming Killer?
13:57
Viraj Shetty
Рет қаралды 22 М.
What is Spring Webflux and when to use it?
17:46
Defog Tech
Рет қаралды 247 М.
Spring Boot with MongoDB CRUD Example
21:44
Full Stack Java Developer
Рет қаралды 221
Reactive Programming with Spring Boot | A Beginner's Guide
40:31
How to Use Redis in Your Spring Boot Project: Step-by-Step Tutorial
42:19
Engineering Digest
Рет қаралды 25 М.