Build a High‑Performance API Gateway with Soul 2.2.0 in 10 Minutes

This article introduces Soul 2.2.0’s fully plugin‑based architecture, walks through downloading and running soul‑admin, shows how to build a Spring Boot gateway with required dependencies and configuration, demonstrates hot‑swap plugins for Dubbo, circuit‑breaker and rate limiting, and highlights its key features and typical use cases.

Programmer DD
Programmer DD
Programmer DD
Build a High‑Performance API Gateway with Soul 2.2.0 in 10 Minutes

Soul releases new architecture 2.2.0 – making gateway simple

We first look at the new features, then the story.

Fully plugin‑based architecture with hot‑plug support.

Complete support for all Dubbo versions, both alibaba‑dubbo and apache‑dubbo.

Support for Dubbo generic calls, multiple and complex parameters.

Enhanced monitor plugin: removed InfluxDB, added memory, CPU, QPS, TPS, latency metrics, and Prometheus integration.

springCloud plugin supports Eureka and Nacos registries.

WAF plugin enhanced with blacklist/whitelist and mixed mode.

Hystrix circuit‑breaker extracted as an independent plugin.

Fixed Zookeeper data sync bug and added Nacos sync.

Multiple soul‑client options for Spring and Spring‑Boot integration.

Optimized soul‑admin UI.

Load‑balancing algorithm bug fixed.

Fixed large‑file upload bug.

… many more improvements.

Experience the new architecture – set up a high‑availability, high‑performance gateway in 10 minutes

Start soul‑admin

Download soul-admin.jar and run it.

wget https://yu199195.github.io/jar/soul-admin.jar
java -jar soul-admin.jar --spring.datasource.url="jdbc:mysql://yoururl:3306/soul?useUnicode=true&characterEncoding=utf-8&useSSL=false" --spring.datasource.username='your username' --spring.datasource.password='your password'

Access http://localhost:9095/index.html (default admin user: admin, password: 123456).

Build your own gateway

Create an empty Spring Boot project (e.g., refer to soul‑bootstrap) and add the following 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>

<!-- soul gateway start -->
<dependency>
    <groupId>org.dromara</groupId>
    <artifactId>soul-spring-boot-starter-gateway</artifactId>
    <version>2.2.0</version>
</dependency>

<!-- soul data sync start use websocket -->
<dependency>
    <groupId>org.dromara</groupId>
    <artifactId>soul-spring-boot-starter-sync-data-websocket</artifactId>
    <version>2.2.0</version>
</dependency>

Add the following to application.yaml:

spring:
  main:
    allow-bean-definition-overriding: true

management:
  health:
    defaults:
      enabled: false
soul:
  sync:
    websocket:
      urls: ws://localhost:9095/websocket   // set to your soul‑admin address

Now the gateway environment is ready.

Plugin hot‑swap demo

Q: How to enable circuit‑breaker?

A: Add the hystrix plugin dependency:

<!-- soul hystrix plugin start -->
<dependency>
    <groupId>org.dromara</groupId>
    <artifactId>soul-spring-boot-starter-plugin-hystrix</artifactId>
    <version>2.2.0</version>
</dependency>
<!-- soul hystrix plugin end -->

Q: How to integrate Dubbo services?

A: For alibaba‑dubbo add:

<!-- soul alibaba dubbo plugin start -->
<dependency>
    <groupId>org.dromara</groupId>
    <artifactId>soul-spring-boot-starter-plugin-alibaba-dubbo</artifactId>
    <version>2.2.0</version>
</dependency>
<!-- soul alibaba dubbo plugin end -->

For apache‑dubbo use the corresponding artifact.

Q: How to enable rate limiting?

A: Add the rate‑limiter plugin dependency:

<!-- soul ratelimiter plugin start -->
<dependency>
    <groupId>org.dromara</groupId>
    <artifactId>soul-spring-boot-starter-plugin-ratelimiter</artifactId>
    <version>2.2.0</version>
</dependency>
<!-- soul ratelimiter plugin end -->

Disable any plugin via the soul‑admin UI.

Soul gateway features

Powerful traffic filtering and control based on various conditions, rules, and matchers, all visual and instantly effective without code changes.

All configurations are stored in the soul‑admin console and synchronized to each gateway node’s JVM memory, enabling high‑performance clustering with long‑polling, WebSocket, Zookeeper, etc.

Implemented with Reactor for non‑blocking, low‑overhead processing; even with ten active plugins latency stays around 1‑2 ms.

Built‑in plugins include rate limiting, circuit breaking, blacklist/whitelist, authentication, and more.

Supports A/B testing and blue‑green deployments.

Typical use cases

Backend management web, company entrance/open platform, unified authentication, rate limiting, monitoring, circuit breaking, handling attacks, etc. Soul gateway solves these by centralizing service registration and traffic control.

Architecture diagram:

Open‑source reflections since version 2.2.0

The author shares experience from building distributed‑transaction projects (LCN, Hmily, Raincat, Myth) to creating Soul gateway, emphasizing the importance of extensible, plug‑in architecture and the distinction between SPI and pure plug‑in designs.

He invites contributions to Apache ShardingSphere and Soul gateway.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

JavaMicroservicesplugin architectureapi-gatewayreactive-programmingSpring Boot
Programmer DD
Written by

Programmer DD

A tinkering programmer and author of "Spring Cloud Microservices in Action"

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.