使用弹簧启动2.0 + WebFlux实现RESTful API功能

  

  

什么是春天WebFlux,它是一种异步的,非阻塞的,支持背压(背压)机制的网络开发框架。要深入了解春天WebFlux,首先要了知道<强> 反应流。另一种编程姿势,和命令式编程相对的姿势。

  

  
      <李>使用@ controller这种基于注解的姿势,与老MVC的姿势相同李   <李>基于Java 8λ的函数式编程风格李   
  

注意:上面只是两种编程的姿势,和“普通话和重庆话都是中国话”是一个道理。我们公司也有外地的,对他我说普通话,对本地同事说重庆话。这叫多态

  

  

通过http://start.spring。io创建项目骨架。

  

使用弹簧启动2.0 + WebFlux实现RESTful API功能”>,</p>
  <p>如果是手工配置,需要添加弹簧的里程碑(里程碑)仓库:</p>
  
  <pre类=   & lt; repositories>   & lt; repository>   & lt; id> spring-snapshots   & lt; name>春天Snapshots   & lt; url> https://repo.spring.io/snapshot</url>   & lt; snapshots>   & lt; enabled> true   & lt;/snapshots>   & lt;/repository>   & lt; repository>   & lt; id> spring-milestones   & lt; name>春天Milestones   & lt; url> https://repo.spring.io/milestone</url>   & lt; snapshots>   & lt; enabled> false   & lt;/snapshots>   & lt;/repository>   & lt;/repositories>      & lt; pluginRepositories>   & lt; pluginRepository>   & lt; id> spring-snapshots   & lt; name>春天Snapshots   & lt; url> https://repo.spring.io/snapshot</url>   & lt; snapshots>   & lt; enabled> true   & lt;/snapshots>   & lt;/pluginRepository>   & lt; pluginRepository>   & lt; id> spring-milestones   & lt; name>春天Milestones   & lt; url> https://repo.spring.io/milestone</url>   & lt; snapshots>   & lt; enabled> false   & lt;/snapshots>   & lt;/pluginRepository>   & lt;/pluginRepositories>      

<强>测试

  

<>强列举所有用户,

  

使用弹簧启动2.0 + WebFlux实现RESTful API功能”>,</p>
  <p> <>强创建用户,</强> </p>
  <p> <img src=使用弹簧启动2.0 + WebFlux实现RESTful API功能