Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

integration transport module with spring-mvc #1957

Merged
merged 20 commits into from Feb 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
1ba3a7b
integration transport module with spring-mvc
shenbaoyong Jan 8, 2021
c5160e8
fix review for #1957
shenbaoyong Jan 16, 2021
d54c2e6
fix review for #1957 code format & triggerSentinelInit
shenbaoyong Jan 23, 2021
24e89cf
fix pr1957 review problem
shenbaoyong Jan 30, 2021
3469fd9
dashboard: Fix issue of memory leak in real-time monitoring page (#1905)
zhangkai253 Dec 28, 2020
a7f3682
Support setting flush interval of the metric log via SentinelConfig p…
brotherlu-xcq Dec 31, 2020
7fe09ff
Refactor SpiLoader and enhance SPI mechanism (#1383)
cdfive Jan 27, 2021
e1540d1
dashboard: authFilterExcludeUrls supports matching path pattern like …
brotherlu-xcq Jan 27, 2021
cf4f364
Improve MetricFetcher under concurrent conditions (#1918)
samuelllin Jan 28, 2021
ebedd6d
dependency: Upgrade fastjson to 1.2.75 (#2006)
liuming-dev Feb 2, 2021
82d2818
dependency: Upgrade snakeyaml to 1.26 in sentinel-cluster-server-envo…
liuming-dev Feb 3, 2021
643850d
Improve RocketMQ integration example (#1757)
PeineLiang Feb 3, 2021
d372ff9
Remove unused code (#1991)
zhouyongshen Feb 4, 2021
a66bc2b
Update source/target JDK version to 1.8 and update documents
sczyh30 Feb 1, 2021
149cf88
Use JDK 1.8 native LongAdder instead and remove legacy LongAdder
sczyh30 Feb 1, 2021
c291c33
Polish SpiLoader and SentinelConfig
sczyh30 Feb 4, 2021
5d63417
Bump version to 1.8.1
sczyh30 Feb 4, 2021
efcda7e
Bump version to 1.8.2-SNAPSHOT
sczyh30 Feb 4, 2021
6cc8684
fix pr1957 review spi-order
shenbaoyong Feb 5, 2021
4ab9f41
fix transport-spring-mvc version
shenbaoyong Feb 5, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -49,16 +49,16 @@ Below is a simple demo that guides new users to use Sentinel in just 3 steps. It

### 1. Add Dependency

**Note:** Sentinel Core requires Java 7 or later.
**Note:** Sentinel requires JDK 1.8 or later.

If your're using Maven, just add the following dependency in `pom.xml`.
If you're using Maven, just add the following dependency in `pom.xml`.

```xml
<!-- replace here with the latest version -->
<dependency>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-core</artifactId>
<version>1.8.0</version>
<version>1.8.1</version>
</dependency>
```

Expand Down
13 changes: 9 additions & 4 deletions pom.xml
Expand Up @@ -5,7 +5,7 @@

<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-parent</artifactId>
<version>1.8.1-SNAPSHOT</version>
<version>1.8.2-SNAPSHOT</version>
<packaging>pom</packaging>

<name>${project.artifactId}</name>
Expand Down Expand Up @@ -41,7 +41,7 @@

<properties>
<!-- Compile libs -->
<fastjson.version>1.2.71</fastjson.version>
<fastjson.version>1.2.75</fastjson.version>
<javax.annotation-api.version>1.3.2</javax.annotation-api.version>

<!-- Test libs -->
Expand All @@ -53,8 +53,8 @@

<!-- Build -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.source.version>1.7</java.source.version>
<java.target.version>1.7</java.target.version>
<java.source.version>1.8</java.source.version>
<java.target.version>1.8</java.target.version>
<java.encoding>UTF-8</java.encoding>
<maven.compiler.version>3.8.0</maven.compiler.version>
<maven.surefire.version>2.22.1</maven.surefire.version>
Expand Down Expand Up @@ -144,6 +144,11 @@
<artifactId>sentinel-transport-netty-http</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-transport-spring-mvc</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-transport-common</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion sentinel-adapter/pom.xml
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-parent</artifactId>
<version>1.8.1-SNAPSHOT</version>
<version>1.8.2-SNAPSHOT</version>
</parent>
<artifactId>sentinel-adapter</artifactId>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion sentinel-adapter/sentinel-apache-dubbo-adapter/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>sentinel-adapter</artifactId>
<groupId>com.alibaba.csp</groupId>
<version>1.8.1-SNAPSHOT</version>
<version>1.8.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>sentinel-adapter</artifactId>
<groupId>com.alibaba.csp</groupId>
<version>1.8.1-SNAPSHOT</version>
<version>1.8.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
7 changes: 1 addition & 6 deletions sentinel-adapter/sentinel-api-gateway-adapter-common/pom.xml
Expand Up @@ -5,18 +5,13 @@
<parent>
<artifactId>sentinel-adapter</artifactId>
<groupId>com.alibaba.csp</groupId>
<version>1.8.1-SNAPSHOT</version>
<version>1.8.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>sentinel-api-gateway-adapter-common</artifactId>
<packaging>jar</packaging>

<properties>
<java.source.version>1.7</java.source.version>
<java.target.version>1.7</java.target.version>
</properties>

<dependencies>
<dependency>
<groupId>com.alibaba.csp</groupId>
Expand Down
Expand Up @@ -27,7 +27,7 @@
import com.alibaba.csp.sentinel.property.PropertyListener;
import com.alibaba.csp.sentinel.property.SentinelProperty;
import com.alibaba.csp.sentinel.util.AssertUtil;
import com.alibaba.csp.sentinel.util.SpiLoader;
import com.alibaba.csp.sentinel.spi.SpiLoader;
import com.alibaba.csp.sentinel.util.StringUtil;

/**
Expand Down Expand Up @@ -59,7 +59,7 @@ public final class GatewayApiDefinitionManager {
}

private static void initializeApiChangeObserverSpi() {
List<ApiDefinitionChangeObserver> listeners = SpiLoader.loadInstanceList(ApiDefinitionChangeObserver.class);
List<ApiDefinitionChangeObserver> listeners = SpiLoader.of(ApiDefinitionChangeObserver.class).loadInstanceList();
for (ApiDefinitionChangeObserver e : listeners) {
API_CHANGE_OBSERVERS.put(e.getClass().getCanonicalName(), e);
RecordLog.info("[GatewayApiDefinitionManager] ApiDefinitionChangeObserver added: {}"
Expand Down
Expand Up @@ -27,13 +27,13 @@
import com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowException;
import com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowRule;
import com.alibaba.csp.sentinel.slots.block.flow.param.ParameterMetricStorage;
import com.alibaba.csp.sentinel.spi.SpiOrder;
import com.alibaba.csp.sentinel.spi.Spi;

/**
* @author Eric Zhao
* @since 1.6.1
*/
@SpiOrder(-4000)
@Spi(order = -4000)
public class GatewayFlowSlot extends AbstractLinkedProcessorSlot<DefaultNode> {

@Override
Expand Down
Expand Up @@ -21,8 +21,9 @@
* @author Eric Zhao
* @since 1.6.1
*
* @deprecated since 1.7.2, we can use @SpiOrder(-4000) to adjust the order of {@link GatewayFlowSlot},
* @deprecated since 1.7.2, we can use @Spi(order = -4000) to adjust the order of {@link GatewayFlowSlot},
* this class is reserved for compatibility with older versions.
*
* @see GatewayFlowSlot
* @see DefaultSlotChainBuilder
*/
Expand Down
2 changes: 1 addition & 1 deletion sentinel-adapter/sentinel-dubbo-adapter/pom.xml
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-adapter</artifactId>
<version>1.8.1-SNAPSHOT</version>
<version>1.8.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>sentinel-dubbo-adapter</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion sentinel-adapter/sentinel-grpc-adapter/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>sentinel-adapter</artifactId>
<groupId>com.alibaba.csp</groupId>
<version>1.8.1-SNAPSHOT</version>
<version>1.8.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>sentinel-grpc-adapter</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion sentinel-adapter/sentinel-jax-rs-adapter/pom.xml
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-adapter</artifactId>
<version>1.8.1-SNAPSHOT</version>
<version>1.8.2-SNAPSHOT</version>
</parent>

<artifactId>sentinel-jax-rs-adapter</artifactId>
Expand Down
18 changes: 3 additions & 15 deletions sentinel-adapter/sentinel-motan-adapter/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>sentinel-adapter</artifactId>
<groupId>com.alibaba.csp</groupId>
<version>1.8.1-SNAPSHOT</version>
<version>1.8.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>sentinel-motan-adapter</artifactId>
Expand All @@ -20,6 +20,7 @@
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-core</artifactId>
</dependency>

<dependency>
<groupId>com.weibo</groupId>
<artifactId>motan-core</artifactId>
Expand All @@ -33,18 +34,5 @@
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.version}</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>${java.encoding}</encoding>
</configuration>
</plugin>
</plugins>
</build>

</project>
2 changes: 1 addition & 1 deletion sentinel-adapter/sentinel-okhttp-adapter/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>sentinel-adapter</artifactId>
<groupId>com.alibaba.csp</groupId>
<version>1.8.1-SNAPSHOT</version>
<version>1.8.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion sentinel-adapter/sentinel-quarkus-adapter/pom.xml
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-adapter</artifactId>
<version>1.8.1-SNAPSHOT</version>
<version>1.8.2-SNAPSHOT</version>
</parent>

<artifactId>sentinel-quarkus-adapter-parent</artifactId>
Expand Down
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-quarkus-adapter-parent</artifactId>
<version>1.8.1-SNAPSHOT</version>
<version>1.8.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-quarkus-adapter-parent</artifactId>
<version>1.8.1-SNAPSHOT</version>
<version>1.8.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-quarkus-adapter-parent</artifactId>
<version>1.8.1-SNAPSHOT</version>
<version>1.8.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-quarkus-adapter-parent</artifactId>
<version>1.8.1-SNAPSHOT</version>
<version>1.8.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-quarkus-adapter-parent</artifactId>
<version>1.8.1-SNAPSHOT</version>
<version>1.8.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-quarkus-adapter-parent</artifactId>
<version>1.8.1-SNAPSHOT</version>
<version>1.8.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 0 additions & 2 deletions sentinel-adapter/sentinel-reactor-adapter/README.md
@@ -1,7 +1,5 @@
# Sentinel Reactor Adapter

> Note: this module requires Java 8 or later version.

Sentinel provides integration module for [Reactor](https://projectreactor.io/).

Add the following dependency in `pom.xml` (if you are using Maven):
Expand Down
2 changes: 1 addition & 1 deletion sentinel-adapter/sentinel-reactor-adapter/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>sentinel-adapter</artifactId>
<groupId>com.alibaba.csp</groupId>
<version>1.8.1-SNAPSHOT</version>
<version>1.8.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion sentinel-adapter/sentinel-sofa-rpc-adapter/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>sentinel-adapter</artifactId>
<groupId>com.alibaba.csp</groupId>
<version>1.8.1-SNAPSHOT</version>
<version>1.8.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
@@ -1,7 +1,5 @@
# Sentinel Spring Cloud Gateway Adapter

> Note: this module requires Java 8 or later version.

Sentinel provides integration module with Spring Cloud Gateway.
The integration module is based on the Sentinel Reactor Adapter.

Expand Down
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>sentinel-adapter</artifactId>
<groupId>com.alibaba.csp</groupId>
<version>1.8.1-SNAPSHOT</version>
<version>1.8.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 0 additions & 2 deletions sentinel-adapter/sentinel-spring-webflux-adapter/README.md
@@ -1,7 +1,5 @@
# Sentinel Spring WebFlux Adapter

> Note: this module requires Java 8 or later version.

Sentinel provides integration module with Spring WebFlux, so reactive web applications can also leverage Sentinel's flow control
and circuit breaking to achieve reliability. The integration module is based on the Sentinel Reactor Adapter.

Expand Down
2 changes: 1 addition & 1 deletion sentinel-adapter/sentinel-spring-webflux-adapter/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>sentinel-adapter</artifactId>
<groupId>com.alibaba.csp</groupId>
<version>1.8.1-SNAPSHOT</version>
<version>1.8.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion sentinel-adapter/sentinel-spring-webmvc-adapter/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-adapter</artifactId>
<version>1.8.1-SNAPSHOT</version>
<version>1.8.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Expand Up @@ -34,12 +34,6 @@ public void handle(HttpServletRequest request, HttpServletResponse response, Blo
// Return 429 (Too Many Requests) by default.
response.setStatus(429);

StringBuffer url = request.getRequestURL();

if ("GET".equals(request.getMethod()) && StringUtil.isNotBlank(request.getQueryString())) {
url.append("?").append(request.getQueryString());
}

PrintWriter out = response.getWriter();
out.print("Blocked by Sentinel (flow limiting)");
out.flush();
Expand Down
2 changes: 1 addition & 1 deletion sentinel-adapter/sentinel-web-servlet/pom.xml
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-adapter</artifactId>
<version>1.8.1-SNAPSHOT</version>
<version>1.8.2-SNAPSHOT</version>
</parent>

<artifactId>sentinel-web-servlet</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion sentinel-adapter/sentinel-zuul-adapter/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>sentinel-adapter</artifactId>
<groupId>com.alibaba.csp</groupId>
<version>1.8.1-SNAPSHOT</version>
<version>1.8.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>sentinel-zuul-adapter</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion sentinel-adapter/sentinel-zuul2-adapter/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>sentinel-adapter</artifactId>
<groupId>com.alibaba.csp</groupId>
<version>1.8.1-SNAPSHOT</version>
<version>1.8.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down