This article describes how to build your own gateway based on Apache ShenYu.
Before you read this document, you need to complete some preparations before deploying Shenyu according to the Deployment Prerequisites document.
docker reference docker deployment Apache ShenYu Admin
liunx/windows reference binary packages deployment Apache ShenYu Admin
first create an empty springboot project, you can refer to shenyu-bootstrap, or you can create it on spring official website.
introduce the following jar package:
<dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-webflux</artifactId> <version>2.2.2.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> <version>2.2.2.RELEASE</version> </dependency> <dependency> <groupId>org.apache.shenyu</groupId> <artifactId>shenyu-spring-boot-starter-gateway</artifactId> <version>${current.version}</version> </dependency> <dependency> <groupId>org.apache.shenyu</groupId> <artifactId>shenyu-spring-boot-starter-sync-data-websocket</artifactId> <version>${current.version}</version> </dependency> </dependencies>
among them, ${project.version} please use the current latest version.
application.yaml file:spring: main: allow-bean-definition-overriding: true management: health: defaults: enabled: false shenyu: sync: websocket: urls: ws://localhost:9095/websocket //set to your shenyu-admin address allowOrigin: ws://localhost:9195