赞
踩
最近做支付项目从大的项目独立出来所以专门搭建了一个网关。上网查了些资料都说SpringCloud GateWay性能比较好所以就搭建了,其中踩了不了坑,包括JWT权限验证、限流等。但这些搭建都算比较容易网上已经有了很多教程。踩的最坑花时间最长的就是支付交易后,接收交易通知服务处理过后返回响应数据接收不到。下面做的仅做简单模拟。
1.搭建一个简单网关
- <?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-parent</artifactId>
- <version>2.1.6.RELEASE</version>
- <relativePath/> <!-- lookup parent from repository -->
- </parent>
- <groupId>com.gate</groupId>
- <artifactId>gateway</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- <name>gateway</name>
- <description>Demo project for Spring Boot</description>
-
- <properties>
- <java.version>1.8</java.version>
- <java.version>1.8</java.version>
- <spring-cloud.version>Greenwich.SR1</spring-cloud.version>
- </properties>
-
-
-
- <dependencies>
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter-gateway</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-test</artifactId>
- <scope>test</scope>
- </dependency>
-
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。