- [Instructor] In this next video, we will be checking out the Reactive Data Layer. First of all, let's take a look a reactive templates. Reactive templates live in the Spring Reactive Data part of the stack. Okay, so what exactly is a reactive template? It is a interface that specifies a basic set of operations executed in a reactive way. Reactive templates form the foundation for Spring Data reactive repositories.
For most operations in the blocking template API, there is a corresponding operation in the reactive template. ReactiveMongoOperations is a reactive template. It is a interface that specifies a basic set of MongoDB operations. These operations are executed in a reactive way. ReactiveMongoOperations is a fluent style API that extends the interface ReactiveFluentMongoOperations.
An example of a implementation of ReactiveMongoOperations is the ReactiveMongoTemplate. This template basically simplifies the use of Reactive MongoDB. Additionally, it contains guardrails that help us avoid common errors. This template focuses on executing the core MongoDB workflow, while application code is expected to provide the Document Model and extract results in a format that it needs.
The ReactiveMongoTemplate executes binary JSON queries, or updates, and we can use a SimpleReactiveMongoDatabaseFactory to get a template instance for a bean that we would be able to autowire into our service layer. Now let's take a look at a code example from ReactiveMongoTemplate. In this example, we map the results of an ad hoc query on a collection to a instance of an object of Type T.
Author
Released
12/5/2018- Project Reactor and Reactive Core
- Spring WebFlux
- Reactive Spring Data with MongoDB
- Bootstrapping a reactive web app with Spring Boot 2
- Writing reactive Spring controllers
- Working with Spring reactive data
- Spring reactive unit testing
- Writing tests using the WebTestClient
Skill Level Intermediate
Duration
Views
Related Courses
-
Spring: Spring Cloud
with Frank P Moley III1h 25m Intermediate
-
Introduction
-
1. Project Reactor
-
Intro to Project Reactor3m 44s
-
Reactive Core3m 32s
-
Flux in detail3m 59s
-
Mono in detail3m 12s
-
Operators overview4m 34s
-
Schedulers3m 42s
-
-
2. Intro to Spring WebFlux
-
Spring WebFlux overview3m 7s
-
WebFlux reactive API4m 40s
-
Web client4m 57s
-
-
3. Intro to Reactive Spring Data
-
Reactive template API2m 19s
-
Reactive repositories3m 2s
-
Brief intro to MongoDB3m 37s
-
-
4. Bootstrap a Reactive Web App with Spring Boot 2
-
Intro to Spring Boot 21m 57s
-
Bootstrap a Spring 5 project2m 26s
-
Import project into IntelliJ3m 43s
-
-
5. Writing Reactive Spring Controllers
-
Controller configuration4m 38s
-
Build out a POST endpoint2m 22s
-
Create purchase domain model4m 57s
-
Functional endpoints: Router2m 59s
-
-
6. Working with Spring Reactive Data
-
Autowire your controller4m 17s
-
7. Spring Reactive Unit Testing
-
WebTestClient39s
-
-
Conclusion
-
Next steps1m 17s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Reactive template API