Skip to content

thiko/edu-spring-cloud-gateway-megastore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Cloud Gateway Megastore example

Architecture

                               /super-prices => /prices             ┌───────────────────────────────┐
                              ┌────────────────────────────────────►│                               │
                              │                                     │   pricing-service             │
                              │                                     │                               │
                              │                                     │   Port: 9090                  │
                              │                                     │   Host: localhost             │
                       ┌──────┴────────────────────────┐            │                               │
                       │                               │            └───────────────────────────────┘
http requests          │  Megastore Gateway            │
─────────────────────► │                               │
                       │  Port: 8080                   │
                       │  Host: localhost              │            ┌───────────────────────────────┐
                       │                               │            │                               │
                       └───────┬───────────────────────┘            │   shopping-cart-service       │
                               │                                    │                               │
                               │                                    │   Port: 9080                  │
                               │                                    │   Host: localhost             │
                               └───────────────────────────────────►│                               │
                                /shoppingcard => /shoppingcard      └───────────────────────────────┘

How to run?

Start each microservice by using mvn spring-boot:run.

How to test it?

Using curl:

  • Query prices through our gateway: curl http://localhost:8080/super-prices | jq
  • Query shopping cart through our gateway: curl -H "x-customer-class: rich" http://localhost:8080/shoppingcard | jq

(jq is optional but recommended)

About

Spring cloud gateway example application

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages