All Projects → spring-cloud-samples → Spring Cloud Gateway Sample

spring-cloud-samples / Spring Cloud Gateway Sample

Licence: apache-2.0
Sample Spring Cloud Gateway Application

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Spring Cloud Gateway Sample

Spring Cloud Kubernetes
Kubernetes integration with Spring Cloud Discovery Client, Configuration, etc...
Stars: ✭ 2,894 (+979.85%)
Mutual labels:  microservices, cloud-native, spring-boot, spring, spring-cloud
Spring Cloud Cli
Spring Cloud CLI features
Stars: ✭ 139 (-48.13%)
Mutual labels:  microservices, cloud-native, spring-boot, spring, spring-cloud
Spring Cloud Zookeeper
Spring Cloud Zookeeper
Stars: ✭ 481 (+79.48%)
Mutual labels:  microservices, cloud-native, spring-boot, spring, spring-cloud
Spring Cloud Security
Security concerns for distributed applications implemented in Spring
Stars: ✭ 488 (+82.09%)
Mutual labels:  microservices, cloud-native, spring-boot, spring, spring-cloud
Spring Cloud Sleuth
Distributed tracing for spring cloud
Stars: ✭ 1,531 (+471.27%)
Mutual labels:  microservices, cloud-native, spring-boot, spring, spring-cloud
Spring Cloud Commons
Common classes used in different Spring Cloud implementations
Stars: ✭ 493 (+83.96%)
Mutual labels:  microservices, cloud-native, spring-boot, spring, spring-cloud
Spring Cloud Netflix
Integration with Netflix OSS components
Stars: ✭ 4,498 (+1578.36%)
Mutual labels:  microservices, cloud-native, spring-boot, spring, spring-cloud
Spring Cloud Release
Spring Cloud Release Train - dependency management across a wide range of Spring Cloud projects.
Stars: ✭ 543 (+102.61%)
Mutual labels:  microservices, cloud-native, spring-boot, spring, spring-cloud
Spring Cloud Cloudfoundry
Integration between Cloudfoundry and the Spring Cloud APIs
Stars: ✭ 83 (-69.03%)
Mutual labels:  microservices, cloud-native, spring-boot, spring, spring-cloud
Spring Cloud Bus
Spring Cloud event bus
Stars: ✭ 342 (+27.61%)
Mutual labels:  microservices, cloud-native, spring-boot, spring, spring-cloud
Spring Cloud Contract
Support for Consumer Driven Contracts in Spring
Stars: ✭ 569 (+112.31%)
Mutual labels:  microservices, cloud-native, spring-boot, spring, spring-cloud
Spring Cloud Consul
Spring Cloud Consul
Stars: ✭ 703 (+162.31%)
Mutual labels:  microservices, cloud-native, spring-boot, spring, spring-cloud
Spring Cloud Config
External configuration (server and client) for Spring Cloud
Stars: ✭ 1,740 (+549.25%)
Mutual labels:  microservices, cloud-native, spring-boot, spring, spring-cloud
Springy Store Microservices
Springy Store is a conceptual simple μServices-based project using the latest cutting-edge technologies, to demonstrate how the Store services are created to be a cloud-native and 12-factor app agnostic. Those μServices are developed based on Spring Boot & Cloud framework that implements cloud-native intuitive, design patterns, and best practices.
Stars: ✭ 318 (+18.66%)
Mutual labels:  microservices, cloud-native, spring-boot, spring-cloud
Java Spring Cloud
Distributed tracing for Spring Boot, Cloud and other Spring projects
Stars: ✭ 326 (+21.64%)
Mutual labels:  microservices, spring-boot, spring, spring-cloud
Spring Cloud Alibaba
Spring Cloud Alibaba provides a one-stop solution for application development for the distributed solutions of Alibaba middleware.
Stars: ✭ 20,934 (+7711.19%)
Mutual labels:  microservices, cloud-native, spring, spring-cloud
Okta Blog Archive
Okta Developer Blog
Stars: ✭ 74 (-72.39%)
Mutual labels:  microservices, spring-boot, spring, spring-cloud
Spring Cloud Build
Common build concerns, shared plugin configuration, etc. for Spring Cloud modules
Stars: ✭ 114 (-57.46%)
Mutual labels:  microservices, spring-boot, spring, spring-cloud
Mini Platform
Mini-Platform致力于更简洁易用的轻量级微服务治理平台。
Stars: ✭ 45 (-83.21%)
Mutual labels:  microservices, spring-boot, spring, spring-cloud
Spring Cloud Example
Stars: ✭ 111 (-58.58%)
Mutual labels:  microservices, spring-boot, spring, spring-cloud

Spring Cloud Gateway Sample

Sample that shows a few different ways to route and showcases some filters.

Run DemogatewayApplication

Samples

$ http :8080/get
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Connection: keep-alive
Content-Length: 257
Content-Type: application/json
Date: Fri, 13 Oct 2017 15:36:12 GMT
Expires: 0
Pragma: no-cache
Server: meinheld/0.6.1
Via: 1.1 vegur
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-Powered-By: Flask
X-Processed-Time: 0.00123405456543
X-XSS-Protection: 1 ; mode=block

{
    "args": {}, 
    "headers": {
        "Accept": "*/*", 
        "Accept-Encoding": "gzip, deflate", 
        "Connection": "close", 
        "Host": "httpbin.org", 
        "User-Agent": "HTTPie/0.9.8"
    }, 
    "origin": "207.107.158.66", 
    "url": "http://httpbin.org/get"
}


$ http :8080/headers Host:www.myhost.org
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Connection: keep-alive
Content-Length: 175
Content-Type: application/json
Date: Fri, 13 Oct 2017 15:36:35 GMT
Expires: 0
Pragma: no-cache
Server: meinheld/0.6.1
Via: 1.1 vegur
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-Powered-By: Flask
X-Processed-Time: 0.0012538433075
X-XSS-Protection: 1 ; mode=block

{
    "headers": {
        "Accept": "*/*", 
        "Accept-Encoding": "gzip, deflate", 
        "Connection": "close", 
        "Host": "httpbin.org", 
        "User-Agent": "HTTPie/0.9.8"
    }
}

$ http :8080/foo/get Host:www.rewrite.org
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Connection: keep-alive
Content-Length: 257
Content-Type: application/json
Date: Fri, 13 Oct 2017 15:36:51 GMT
Expires: 0
Pragma: no-cache
Server: meinheld/0.6.1
Via: 1.1 vegur
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-Powered-By: Flask
X-Processed-Time: 0.000664949417114
X-XSS-Protection: 1 ; mode=block

{
    "args": {}, 
    "headers": {
        "Accept": "*/*", 
        "Accept-Encoding": "gzip, deflate", 
        "Connection": "close", 
        "Host": "httpbin.org", 
        "User-Agent": "HTTPie/0.9.8"
    }, 
    "origin": "207.107.158.66", 
    "url": "http://httpbin.org/get"
}

$ http :8080/delay/2 Host:www.hystrix.org
HTTP/1.1 504 Gateway Timeout
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Expires: 0
Pragma: no-cache
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1 ; mode=block
content-length: 0


Websocket Sample

install wscat

In one terminal, run websocket server:

wscat --listen 9000

In another, run a client, connecting through gateway:

wscat --connect ws://localhost:8080/echo

type away in either server and client, messages will be passed appropriately.

Running Redis Rate Limiter Test

Make sure redis is running on localhost:6379 (using brew or apt or docker).

Then run DemogatewayApplicationTests. It should pass which means one of the calls received a 429 TO_MANY_REQUESTS HTTP status.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].