Overview
What is Spring WebFlux? It is an asynchronous, non-blocking, web development framework that supports backpressure mechanism. To gain insight into Spring WebFlux, we must first know Reactive Stream . Another programming posture, which is opposite to imperative programming.
WebFlux supports two programming styles (poses) and pattern (potentials)
Note: The above are just two programming postures, which are the same as "Mandarin and Chongqing dialect are both Chinese". Our company also has people from other places, and I speak Mandarin and Chongqing dialect to local colleagues. This is called polymorphism
Create a project
Create project skeletons via http://start.spring.io.
If it is manually configured, you need to add Spring's Milestone repository:
<repository> <repository> <id>spring-snapshots</id> <name>Spring Snapshots</name> <url>https://repo.spring.io/snapshot</url> <snapshots> <enabled>true</enabled> </snapshots> </repository> <repository> <id>spring-milestones</id> <name>Spring Milestones</name> <url>https://repo.spring.io/milestone</url> <snapshots> <enabled>false</enabled> </snapshots> </repository></repository></repository><pluginRepository> <pluginRepository> <id>spring-snapshots</id> <name>Spring Snapshots</name> <url>https://repo.spring.io/snapshot</url> <snapshots> <enabled>true</enabled> </snapshots> </pluginRepository> <pluginRepository> <id>spring-milestones</id> <name>Spring Milestones</name> <url>https://repo.spring.io/milestone</url> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository></pluginRepositories>
test
List all users
Create a user
Get a single user
Revise
delete
Source code
demo-spring-boot-webflux-annotaion
Summarize
The above is what the editor introduced to you to use Spring Boot 2.0 + WebFlux to implement the RESTful API function. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to everyone in time. Thank you very much for your support to Wulin.com website!