Project for Spring Reactive Web (Spring WebFlux and Netty)
Open the Spring initialize : https://start.spring.io/;
Steps | Version/Language |
---|---|
Select the Project | Gradle -Kotlin |
Select the Language | Kotlin |
Select Spring Boot Version | 3.2.0 |
Group Name | com.example |
Artifact Name | demo11 |
Name | demo11 |
Project Description | Demo Project for Spring Boot |
Package Name | com.example.demo11 |
Select Packaging | Jar |
Select the Java version | 17 (JDK) |
Add the Dependencies | Spring Reactive Web (Spring WebFlux and Netty.) and Spring Boot DevTool |
Click on the Generate button.
Download the generated project file.
Extract the project file into a particular folder.
Open the IntelliJ idea. Click on the file menu and open the project file.
Write click on the project's package file(com.example.demo11) and create a simple class.
Write click on the package. Create a new Kotlin class. Create a function inside the class. Add @RestController and @GetMapping annotations in the class and Run the program.
Launch Postman API Tool. Put the URL and choose the Get Method. Click on the send button to execute the API call.
Launch Google Chrome. Put the URL in the search bar and hit the Enter button.
Example of Mono:
Write click on the package. Create a new Kotlin class. Create a function inside the class. Add @RestController and @GetMapping annotation with Mono publisher
Launch Postman API Tool. Put the URL and choose the Get Method. Click on the send button to execute the API call.
Example of flux:
Write click on the package. Create a new Kotlin class. Create a function inside the class Add @RestController and @GetMapping annotation
Launch Postman API Tool. Put the URL and choose the Get Method. Click on the send button to execute the API call.