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

Load balancing improvements #17

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# spring-cloud-netflix-zuul-websocket
A simple library to enable Zuul reverse proxy web socket support in spring applications.
The library has rate limit support using the https://github.com/marcosbarbero/spring-cloud-zuul-ratelimit library.
The rate limit support is optional and can be disabled.

## USAGE

Expand All @@ -9,7 +11,7 @@ spring-cloud-netflix-zuul-websocket is available from **Maven Central**
<dependency>
<groupId>com.github.mthizo247</groupId>
<artifactId>spring-cloud-netflix-zuul-websocket</artifactId>
<version>1.0.0-RELEASE</version>
<version>1.0.8-RELEASE</version>
</dependency>
```

Expand Down Expand Up @@ -45,12 +47,41 @@ zuul:
path: /**
url: http://localhost:7079
customSensitiveHeaders: true
ratelimit:
key-prefix: your-prefix
enabled: true
repository: REDIS
behind-proxy: true
default-policy-list: #optional - will apply unless specific policy exists
- limit: 10 #optional - request number limit per refresh interval window
quota: 1000 #optional - request time limit per refresh interval window (in seconds)
refresh-interval: 60 #default value (in seconds)
type: #optional
- user
- origin
- url
policy-list:
hello:
- limit: 10 #optional - request number limit per refresh interval window
quota: 1000 #optional - request time limit per refresh interval window (in seconds)
refresh-interval: 60 #default value (in seconds)
type: #optional
- user
- origin
- url
- type: #optional value for each type
- user=anonymous
- origin=somemachine.com
- url=/api #url prefix
- role=user
ws:
brokerages:
hello:
end-points: /ws
brokers: /topic
destination-prefixes: /app
reconnectRetries: 2
reconnectInterval: 10000
```

With this you should have web sockets to your back-end service working correctly.
Expand Down
31 changes: 22 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>com.github.mthizo247</groupId>
<artifactId>spring-cloud-netflix-zuul-websocket</artifactId>
<packaging>jar</packaging>
<version>1.0.7.RELEASE</version>
<version>1.0.11.RELEASE</version>
<name>Spring Cloud Netflix Zuul Websocket</name>
<description>Spring Cloud Netflix Zuul Websocket</description>
<url>https://www.discovery.co.za</url>
Expand Down Expand Up @@ -58,21 +58,21 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.7</java.version>
<java.version>1.8</java.version>
</properties>

<distributionManagement>
<repository>
<distributionManagement>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
</repository>
<snapshotRepository>
</repository>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
</snapshotRepository>
</distributionManagement>

<dependencies>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
Expand All @@ -94,6 +94,11 @@
<artifactId>spring-security-oauth2</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.marcosbarbero.cloud</groupId>
<artifactId>spring-cloud-zuul-ratelimit</artifactId>
<version>2.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
Expand Down Expand Up @@ -129,6 +134,14 @@
<stagingProfileId>5820c8da7e998d</stagingProfileId>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>

Expand Down

This file was deleted.

Loading