当前位置: 首页 > news >正文

入职中企动力一月有感seo公司多少钱

入职中企动力一月有感,seo公司多少钱,长春网站建设外包,网页设置背景图片一 概括 最近,我也一直在使用SpringCloudGateway开发我们自己的网关产品。根据我对官网文档:https://docs.spring.io/spring-cloud-gateway/reference/spring-cloud-gateway-server-mvc.html 的理解,内容如下: SpringCloudGatew…

一 概括

最近,我也一直在使用SpringCloudGateway开发我们自己的网关产品。根据我对官网文档:https://docs.spring.io/spring-cloud-gateway/reference/spring-cloud-gateway-server-mvc.html
的理解,内容如下:

SpringCloudGateway的默认底层依赖项是SpringWebflux。我们知道Spring Webflux是异步和响应式编程,并且编程范式是使用流范式编写的;

那么SpringCloudGateway支持同步网关吗?官方支持,官方网站提供了相应的解决方案,即将默认的底层Webflux切换到SpringMVC以支持同步;

相当于SpringCloudGateway为您提供了两种网关路由的底层实现,一种是对应于SpringWebflux的异步实现,另一种是与SpringMVC对应的同步实现。

二 spring-cloud-starter-gateway-mvc例子

1 pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.winning.gate</groupId><artifactId>mvc-gateway</artifactId><version>1.0-SNAPSHOT</version><properties><maven.compiler.source>17</maven.compiler.source><maven.compiler.target>17</maven.compiler.target><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding></properties><dependencyManagement><dependencies><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-dependencies</artifactId><version>2023.0.0</version><type>pom</type><scope>import</scope></dependency></dependencies></dependencyManagement><dependencies><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-gateway-mvc</artifactId></dependency></dependencies></project>

2 application.yml:

server:port: 9098

3 com.demo.GatewaySampleApplication:

package com.demo;import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;/*** @author xch* 2023/12/15 16:56*/
@SpringBootApplication
public class GatewaySampleApplication {public static void main(String[] args) {SpringApplication.run(GatewaySampleApplication.class, args);}}

4 com.demo.SimpleGateway

package com.demo;import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.function.RouterFunction;
import org.springframework.web.servlet.function.ServerResponse;import static org.springframework.cloud.gateway.server.mvc.handler.GatewayRouterFunctions.route;
import static org.springframework.cloud.gateway.server.mvc.handler.HandlerFunctions.http;/*** @author xch* 2023/12/15 16:52*/@Configuration
class SimpleGateway {@Beanpublic RouterFunction<ServerResponse> getRoute() {return route().GET("/demo", http("http://localhost:8080/")).build();}
}

Above is all the code

5 Request Results

GET http://localhost:9098/demo?ceshi=ceshiHTTP/1.1 200 
date: Fri, 15 Dec 2023 09:23:37 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Keep-Alive: timeout=60
Connection: keep-alive{"code": 0,"data": "ceshi"
}
Response file saved.
> 2023-12-15T172337.200.jsonResponse code: 200; Time: 19ms (19 ms); Content length: 25 bytes (25 B)

The destination service address of the route is in SimpleGateway, you can change it to your own service

http://www.tj-hxxt.cn/news/96173.html

相关文章:

  • 网站没有做适配 怎么办今日新闻 最新消息 大事
  • 轻淘客的轻网站怎么做企业网站类型有哪些
  • 群晖wordpress端口河南郑州网站推广优化外包
  • 定制开发软件税率百度灰色词优化排名
  • 网站做调查需要考虑的内容网站流量监控
  • 做商城网站建设哪家好免费发布信息网网站
  • 做网站算软件行业吗最近几天发生的新闻大事
  • 东莞广告公司东莞网站建设网站提交百度收录
  • 局域网内建网站怎样进行seo优化
  • 北京天通苑网站建设搜索引擎优化的定义是什么
  • 自己做的网站怎么设置关键词推广产品引流的最佳方法
  • 长春网站建设制作宁波网站建设方案推广
  • 网站二维码收费怎么做湖南网站排名
  • 网站开发支付宝网站免费网站免费优化优化
  • asp.net h5网站开发网站推广一般多少钱
  • wordpress新闻站自动采集器云优化seo软件
  • 自己做网站赚钱案例网站友链外链
  • 镇江网站制作湖南专业seo公司
  • 个人作品网站怎么做厨师培训
  • 衡水淘宝的网站建设网站快速排名优化报价
  • wordpress king主题搜索引擎优化有哪些要点
  • 哪个网站可以找到毕业设计星链seo管理
  • 网站建设改版公司app推广注册赚钱
  • 网站做com合net的区别seo编辑培训
  • 合肥营销网站建设公司关键词优化策略
  • 网站客服代码左右seo网站推广经理招聘
  • 哪些网站是php做的关键词搜索引擎又称为
  • 沙井网站制作太原关键词优化软件
  • 公司网站注销流程推动防控措施持续优化
  • 高端网站建设创新站长工具使用