├── .gitignore
├── README.md
├── boot-admin-server
├── README.md
├── pom.xml
└── src
│ └── main
│ ├── java
│ └── org
│ │ └── mvnsearch
│ │ └── boot
│ │ └── admin
│ │ └── server
│ │ └── BootAdminServerApplication.java
│ └── resources
│ └── application.properties
├── cloud-config-server
├── README.md
├── configserver.yml
├── pom.xml
└── src
│ └── main
│ ├── java
│ └── org
│ │ └── mvnsearch
│ │ └── boot
│ │ └── config
│ │ └── server
│ │ └── CloudConfigServerApplication.java
│ └── resources
│ └── application.properties
├── cloud-data-flow-server
├── README.md
├── pom.xml
└── src
│ └── main
│ ├── java
│ └── org
│ │ └── mvnsearch
│ │ └── boot
│ │ └── data
│ │ └── flow
│ │ └── CloudDataFlowServerApplication.java
│ └── resources
│ └── application.yml
├── cloud-gateway
├── README.md
├── pom.xml
└── src
│ └── main
│ ├── java
│ └── org
│ │ └── mvnsearch
│ │ └── gateway
│ │ └── CloudGatewayApplication.java
│ └── resources
│ └── application.yml
├── cloud-registry-server
├── README.md
├── pom.xml
└── src
│ └── main
│ ├── java
│ └── org
│ │ └── mvnsearch
│ │ └── boot
│ │ └── registry
│ │ └── server
│ │ └── CloudRegistryServerApplication.java
│ └── resources
│ └── application.yml
├── cloud-skipper-server
├── README.md
├── pom.xml
└── src
│ └── main
│ ├── java
│ └── org
│ │ └── mvnsearch
│ │ └── boot
│ │ └── skipper
│ │ └── server
│ │ └── CloudSkipperServerApplication.java
│ └── resources
│ └── application.properties
├── docker-compose.yml
├── microapp-1
├── README.md
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── org
│ │ │ └── mvnsearch
│ │ │ └── app1
│ │ │ ├── Microapp1Application.java
│ │ │ └── PortalController.java
│ └── resources
│ │ ├── application.properties
│ │ ├── bootstrap.properties
│ │ └── logback-spring.xml
│ └── test
│ ├── java
│ └── org
│ │ └── mvnsearch
│ │ └── app1
│ │ └── Microapp1ApplicationTests.java
│ └── resources
│ └── logback-test.xml
├── microapp-2
├── README.md
├── import_data.sh
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── org
│ │ │ └── mvnsearch
│ │ │ └── app2
│ │ │ ├── Microapp2Application.java
│ │ │ └── PortalController.java
│ └── resources
│ │ ├── application.properties
│ │ ├── bootstrap.properties
│ │ └── logback-spring.xml
│ └── test
│ ├── java
│ └── org
│ │ └── mvnsearch
│ │ └── app2
│ │ └── Microapp2ApplicationTests.java
│ └── resources
│ └── logback-test.xml
├── microapp-3
├── README.md
├── pom.xml
└── src
│ └── main
│ ├── java
│ └── org
│ │ └── mvnsearch
│ │ └── app1
│ │ ├── Microapp3Application.java
│ │ └── PortalController.java
│ └── resources
│ ├── application.properties
│ ├── bootstrap.properties
│ └── logback-spring.xml
├── microapp-hystrix
├── README.md
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── org
│ │ │ └── mvnsearch
│ │ │ └── app4
│ │ │ ├── MicroappHystrixApplication.java
│ │ │ ├── UserController.java
│ │ │ └── domain
│ │ │ ├── infra
│ │ │ ├── HttpBinAutoConfiguration.java
│ │ │ ├── HttpBinResponse.java
│ │ │ ├── HttpBinServiceFeignAPI.java
│ │ │ ├── HttpBinServiceRetrofitAPI.java
│ │ │ └── retrofit
│ │ │ │ ├── HystrixCallAdapter.java
│ │ │ │ └── HystrixCallAdapterFactory.java
│ │ │ └── service
│ │ │ ├── UserService.java
│ │ │ └── UserServiceImpl.java
│ └── resources
│ │ ├── application.properties
│ │ ├── bootstrap.properties
│ │ └── logback-spring.xml
│ └── test
│ └── java
│ └── org
│ └── mvnsearch
│ └── app4
│ ├── HttpRequestTest.java
│ ├── HystrixApplicationBaseTest.java
│ └── domain
│ └── infra
│ ├── HttpBinServiceFeignAPITest.java
│ └── HttpBinServiceRetrofitAPITest.java
├── microapp-proxy
├── README.md
├── pom.xml
├── proxy.http
└── src
│ └── main
│ ├── java
│ └── org
│ │ └── mvnsearch
│ │ └── proxy
│ │ ├── MicroProxyApplication.java
│ │ └── PortalController.java
│ └── resources
│ └── application.properties
├── pom.xml
├── sidecar-1
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── org
│ │ │ └── mvnsearch
│ │ │ └── Sidecar1Application.java
│ └── resources
│ │ └── application.yml
│ └── test
│ └── java
│ └── org
│ └── mvnsearch
│ └── Sidecar1ApplicationTests.java
├── task-demo
├── README.md
├── pom.xml
└── src
│ └── main
│ ├── java
│ └── org
│ │ └── mvnsearch
│ │ ├── DemoTaskApplication.java
│ │ └── TaskListener.java
│ └── resources
│ └── application.properties
└── zuul-proxy
├── pom.xml
└── src
└── main
├── java
└── org
│ └── mvnsearch
│ ├── ZuulProxyDemoApplication.java
│ ├── controller
│ ├── PortalController.java
│ └── SpikeController.java
│ └── filter
│ └── AuthFilter.java
└── resources
└── application.yml
/.gitignore:
--------------------------------------------------------------------------------
1 | ### application tempates
2 | *.log
3 |
4 | # Created by .ignore support plugin (hsz.mobi)
5 | ### Java template
6 | *.class
7 |
8 | # Mobile Tools for Java (J2ME)
9 | .mtj.tmp/
10 |
11 | # Package Files #
12 | *.jar
13 | *.war
14 | *.ear
15 |
16 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
17 | hs_err_pid*
18 | ### JetBrains template
19 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
20 |
21 | *.iml
22 |
23 | ## Directory-based project format:
24 | .idea/
25 | # if you remove the above rule, at least ignore the following:
26 |
27 | # User-specific stuff:
28 | # .idea/workspace.xml
29 | # .idea/tasks.xml
30 | # .idea/dictionaries
31 |
32 | # Sensitive or high-churn files:
33 | # .idea/dataSources.ids
34 | # .idea/dataSources.xml
35 | # .idea/sqlDataSources.xml
36 | # .idea/dynamic.xml
37 | # .idea/uiDesigner.xml
38 |
39 | # Gradle:
40 | # .idea/gradle.xml
41 | # .idea/libraries
42 |
43 | # Mongo Explorer plugin:
44 | # .idea/mongoSettings.xml
45 |
46 | ## File-based project format:
47 | *.ipr
48 | *.iws
49 |
50 | ## Plugin-specific files:
51 |
52 | # IntelliJ
53 | /out/
54 |
55 | # mpeltonen/sbt-idea plugin
56 | .idea_modules/
57 |
58 | # JIRA plugin
59 | atlassian-ide-plugin.xml
60 |
61 | # Crashlytics plugin (for Android Studio and IntelliJ)
62 | com_crashlytics_export_strings.xml
63 | crashlytics.properties
64 | crashlytics-build.properties
65 |
66 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Spring Boot MicroServices
2 | ==================================
3 |
4 | Spring Boot 1.5.x MicroServices
5 |
6 | ### environment
7 |
8 | please install Java 8 JCE: http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html
9 |
10 | ### Services
11 |
12 | * Config Server
13 | * Eureka Registry Server
14 | * Spring Boot Admin Server
15 | * Spring Cloud DataFlow Server
16 | * Spring Cloud Skipper Ser
17 | * Spring Cloud Gateway
18 | * Zull Reverse Proxy
19 | * Charon Reverse Proxy
20 | * Spring Cloud Hystrix
21 |
22 | ### How to start services
23 |
24 | * Start Eureka
25 | * Start Config Server(integrated with eureka)
26 | * Start Spring Boot Admin (integrated with eureka)
27 |
28 | ### Maven plugins
29 |
30 | * maven-compiler-plugin: 1.8 compile
31 | * spring-boot-maven-plugin: build-info
32 | * git-commit-id-plugin: git full mode
33 |
34 | ###Spring Cloud Consul
35 |
36 | #### Startup
37 |
38 | * docker-compose up -d
39 | * visit http://localhost:8500/ui/ for Consul
40 | * visit http://localhost:9411/zipkin/ for Zipkin
41 |
42 | #### Consul Configuration
43 |
44 | Consul Key/Value支持的Spring config Server目录结构如下:
45 |
46 | config/testApp,dev/
47 | config/testApp/
48 | config/application,dev/
49 | config/application/
50 |
51 | 接下来就是在这些目录下创建对应的Key/Value。
52 |
53 | * MicroServices with Consul: https://www.infoq.com/articles/Microservices-SpringBoot
54 |
55 | ### Tips
56 |
57 | * 不同Spring Boot加载的配置问题,可以通过 --spring.profiles.active=15X 来激活全局的 application-15X.properties这样
58 |
59 | ### Reference
60 |
61 | * Spring Cloud: http://cloud.spring.io/spring-cloud-static/Camden.SR3/
62 | * Spring Cloud Netflix: http://cloud.spring.io/spring-cloud-static/spring-cloud-netflix/1.2.3.RELEASE/
63 | * Spring Cloud Consul: http://cloud.spring.io/spring-cloud-consul/
64 | * Spring Cloud ZooKeeper: http://cloud.spring.io/spring-cloud-zookeeper/spring-cloud-zookeeper.html
65 | * Spring Cloud CLI Launcher: https://spring.io/blog/2016/11/02/introducing-the-spring-cloud-cli-launcher
66 |
--------------------------------------------------------------------------------
/boot-admin-server/README.md:
--------------------------------------------------------------------------------
1 | Spring Boot Admin Server
2 | ==================================
3 | Admin UI for administration of spring boot applications.
4 |
5 | ### how to start server
6 | Spring Boot Admin Server integrates with Eureka to fetch applications.
7 |
8 | * Start Eureka Server first
9 | * Start Spring Boot Admin Server.
10 |
11 | ### How to use in applications
12 | Spring Boot Admin has been integrated with Eureka Registry Server, and Boot Admin will fetch all applications from registry server.
13 |
14 | * If you want to enable JMX-HTTP support, such log view, please add Jolokia dependency:
15 | ```xml
16 |
17 | org.jolokia
18 | jolokia-core
19 |
20 | ```
21 | * Add JMX support in your logback-spring.xml:
22 | ```xml
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 | ```
40 | * Open browser to visit boot admin server and check: http://localhost:9761
41 |
42 | ### references
43 |
44 | * Spring Boot Admin Security: https://dzone.com/articles/a-look-at-spring-boot-admin
45 | * Spring Boot Admin Docs: http://codecentric.github.io/spring-boot-admin/1.4.4/
46 | * Spring Boot Admin Git: https://github.com/codecentric/spring-boot-admin
47 |
--------------------------------------------------------------------------------
/boot-admin-server/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 |
7 | org.mvnsearch
8 | spring-boot-microservices
9 | 1.0.0-SNAPSHOT
10 |
11 |
12 | boot-admin-server
13 | 1.0.0-SNAPSHOT
14 | jar
15 |
16 | boot-admin-server
17 | Spring Boot admin Server
18 |
19 | 1.5.7
20 |
21 |
22 |
23 |
24 | org.springframework.boot
25 | spring-boot-starter-actuator
26 |
27 |
28 | de.codecentric
29 | spring-boot-admin-server
30 | ${spring-boot-admin.version}
31 |
32 |
33 | de.codecentric
34 | spring-boot-admin-server-ui
35 | ${spring-boot-admin.version}
36 |
37 |
38 | de.codecentric
39 | spring-boot-admin-server-ui-hystrix
40 | ${spring-boot-admin.version}
41 |
42 |
43 | de.codecentric
44 | spring-boot-admin-server-ui-turbine
45 | ${spring-boot-admin.version}
46 |
47 |
48 | org.springframework.cloud
49 | spring-cloud-starter-eureka
50 |
51 |
52 | org.springframework.boot
53 | spring-boot-starter-test
54 | test
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/boot-admin-server/src/main/java/org/mvnsearch/boot/admin/server/BootAdminServerApplication.java:
--------------------------------------------------------------------------------
1 | package org.mvnsearch.boot.admin.server;
2 |
3 | import de.codecentric.boot.admin.config.EnableAdminServer;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
7 |
8 | @SpringBootApplication
9 | @EnableAdminServer
10 | @EnableDiscoveryClient
11 | public class BootAdminServerApplication {
12 |
13 | public static void main(String[] args) {
14 | SpringApplication.run(BootAdminServerApplication.class, args);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/boot-admin-server/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | server.port=9761
2 | spring.application.name=SpringBootAdminServer
3 | management.security.enabled=false
4 | zuul.forceOriginalQueryStringEncoding=true
5 | spring.boot.admin.routes.endpoints= env,metrics,dump,jolokia,info,configprops,trace,logfile,refresh,flyway,liquibase,heapdump,loggers,auditevents,hystrix.stream
6 |
7 | spring.boot.admin.turbine.location=turbine
8 | spring.boot.admin.turbine.clusters=default
9 |
10 | ### eureka
11 | eureka.client.serviceUrl.defaultZone=http://localhost:8761/eureka/
12 | eureka.client.fetch-registry=true
13 | eureka.instance.lease-renewal-interval-in-seconds=10
14 | eureka.client.registry-fetch-interval-seconds=5
--------------------------------------------------------------------------------
/cloud-config-server/README.md:
--------------------------------------------------------------------------------
1 | Cloud Config Server
2 | =====================================
3 | Spring Cloud Config provides server and client-side support for externalized configuration in a distributed system.
4 |
5 | ### Settings
6 |
7 | Please change git url in application.properties, and you can check by http://localhost:8888/configserver/default
8 |
9 | ### How to use
10 |
11 | * please add dependency in your pom.xml.
12 | ```xml
13 |
14 |
15 | org.springframework.cloud
16 | spring-cloud-starter-config
17 |
18 | ```
19 | * Bootstrap Environment from server. In your bootstrap.properties add following code:
20 | ```
21 | spring.cloud.config.uri: http://localhost:8888/
22 | ```
23 | * Verify your properties:
24 | ```
25 | $ curl http://localhost:8888/demo/master
26 | $ curl http://localhost:8888/demo/prod/master
27 | ```
28 | * add @RefreshScope for your bean
29 | * Change properties and push them to git repository
30 | * Invoke 'curl -X POST http://localhost:8080/refresh' to refresh config
31 |
32 | ### Testing
33 | Config Server with Git adopts following rules to get configuration:
34 |
35 | * properties or yml: "/{name}/{profile}/{label}": name is application name, profile is Spring profile name, and label is git branch or tag name.
36 |
37 |
38 | $ http http://localhost:8888/demo/default/master
39 |
40 |
41 | * plain text: "/{name}/{profile}/{label}/{path}"
42 |
43 | $ curl http://localhost:8888/demo/default/master/demo.conf
44 | $ curl http://localhost:8888/demo/default/master/hibernate/demo.xml
45 |
46 | ### how to write properties file
47 |
48 | 1. application.properties: global properties for all apps
49 | 2. appname.properties: app properties
50 | 3. appname-profile.properties: app profile properties
51 |
52 | ### How to integrate with Eureka
53 |
54 | * Add spring-cloud-starter-eureka dependency in your pom.xml:
55 | ```xml
56 |
57 | org.springframework.cloud
58 | spring-cloud-starter-eureka
59 |
60 | ```
61 | * Add @EnableDiscoveryClient in your applictaion
62 | * add property in the applicaton.properties
63 | ```properties
64 | eureka.instance.prefer-ip-address=true
65 | eureka.client.fetch-registry=false
66 | eureka.client.serviceUrl.defaultZone=http://localhost:8761/eureka/
67 | ```
68 |
69 | ### Spring Cloud CLI Launcher
70 |
71 | please copy configserver.yml to $HOME/.spring-cloud/configserver.yml and execute:
72 |
73 | $ spring cloud configserver
74 |
75 | ### 支持的git url
76 |
77 | * file: file:///${user.home}/config-repo
78 | * git https url: https://github.com/myorg/{application}
79 | * git url: git@gitlab.yourdomain.com:myorg/config-repo
80 |
81 | ### References
82 |
83 | * Spring Config Server: http://cloud.spring.io/spring-cloud-config/spring-cloud-config.html
84 |
85 |
--------------------------------------------------------------------------------
/cloud-config-server/configserver.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | profiles:
3 | active: git
4 | cloud:
5 | config:
6 | server:
7 | git:
8 | uri: https://github.com/spring-cloud-samples/config-repo
9 | encrypt:
10 | key: 123456
--------------------------------------------------------------------------------
/cloud-config-server/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 |
7 | org.mvnsearch
8 | spring-boot-microservices
9 | 1.0.0-SNAPSHOT
10 |
11 |
12 | cloud-config-server
13 | 1.0.0-SNAPSHOT
14 | jar
15 |
16 | cloud-config-server
17 | Spring Boot Cloud Config Server
18 |
19 |
20 |
21 | org.springframework.boot
22 | spring-boot-starter-actuator
23 |
24 |
25 | org.springframework.boot
26 | spring-boot-starter-web
27 |
28 |
29 | org.springframework.cloud
30 | spring-cloud-config-server
31 |
32 |
33 | org.jolokia
34 | jolokia-core
35 |
36 |
37 | org.springframework.cloud
38 | spring-cloud-starter-eureka
39 |
40 |
41 | org.springframework.boot
42 | spring-boot-starter-test
43 | test
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/cloud-config-server/src/main/java/org/mvnsearch/boot/config/server/CloudConfigServerApplication.java:
--------------------------------------------------------------------------------
1 | package org.mvnsearch.boot.config.server;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
6 | import org.springframework.cloud.config.server.EnableConfigServer;
7 |
8 | @SpringBootApplication
9 | @EnableConfigServer
10 | @EnableDiscoveryClient
11 | public class CloudConfigServerApplication {
12 |
13 | public static void main(String[] args) {
14 | SpringApplication.run(CloudConfigServerApplication.class, args);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/cloud-config-server/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.application.name=configserver
2 | server.port=8888
3 | management.port=8889
4 | encrypt.key=abc123
5 |
6 | ### git config
7 | spring.cloud.config.server.git.clone-on-start=true
8 | spring.cloud.config.server.git.uri=https://github.com/linux-china/config-repo
9 | spring.cloud.config.server.health.enabled=false
10 |
11 | ### ops
12 | eureka.instance.prefer-ip-address=true
13 | eureka.client.fetch-registry=false
14 | eureka.client.serviceUrl.defaultZone=http://localhost:8761/eureka/
15 | eureka.instance.metadata-map.management.port=${management.port:-${server.port}}
--------------------------------------------------------------------------------
/cloud-data-flow-server/README.md:
--------------------------------------------------------------------------------
1 | Spring Cloud Data Flow Server
2 | =============================
3 | Spring Cloud DataFlow Server for Stream and Task/Batch Applications.
4 |
5 | ### Development
6 | Please visit http://localhost:9393/dashboard/index.html after start.
7 |
8 | ### Reference
9 |
10 | * DataFlow Server: http://docs.spring.io/spring-cloud-dataflow/docs/1.0.1.RELEASE/reference/html/
11 | * Spring Cloud Stream App Starters: http://cloud.spring.io/spring-cloud-stream-app-starters/
--------------------------------------------------------------------------------
/cloud-data-flow-server/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 |
7 | org.mvnsearch
8 | spring-boot-microservices
9 | 1.0.0-SNAPSHOT
10 |
11 |
12 | cloud-data-flow-server
13 | 1.0.0-SNAPSHOT
14 | jar
15 |
16 | cloud-data-flow-server
17 | Spring Boot Cloud Data flow Server
18 |
19 |
20 | 1.7.4.RELEASE
21 | 1.2.4.RELEASE
22 | 5.2.17.Final
23 |
24 |
25 |
26 |
27 | org.springframework.boot
28 | spring-boot-starter
29 |
30 |
31 | org.springframework.boot
32 | spring-boot-starter-actuator
33 |
34 |
35 | org.springframework.cloud
36 | spring-cloud-starter-dataflow-server-local
37 |
38 |
39 | org.springframework.cloud
40 | spring-cloud-task-core
41 | ${cloud-task.version}
42 |
43 |
44 | org.springframework.cloud
45 | spring-cloud-deployer-resource-support
46 | 1.3.4.RELEASE
47 |
48 |
49 | mysql
50 | mysql-connector-java
51 |
52 |
53 | org.hibernate
54 | hibernate-core
55 | ${hibernate.version}
56 |
57 |
58 | org.hibernate
59 | hibernate-entitymanager
60 | ${hibernate.version}
61 |
62 |
63 | org.springframework.boot
64 | spring-boot-starter-test
65 | test
66 |
67 |
68 |
69 |
70 |
71 |
72 | org.springframework.cloud
73 | spring-cloud-dataflow-dependencies
74 | ${cloud-dataflow.version}
75 | pom
76 | import
77 |
78 |
79 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/cloud-data-flow-server/src/main/java/org/mvnsearch/boot/data/flow/CloudDataFlowServerApplication.java:
--------------------------------------------------------------------------------
1 | package org.mvnsearch.boot.data.flow;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 | import org.springframework.cloud.dataflow.server.EnableDataFlowServer;
6 |
7 | @SpringBootApplication
8 | @EnableDataFlowServer
9 | public class CloudDataFlowServerApplication {
10 |
11 | public static void main(String[] args) {
12 | SpringApplication.run(CloudDataFlowServerApplication.class, args);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/cloud-data-flow-server/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | application:
3 | name: dataflow
4 | datasource:
5 | driver-class-name: com.mysql.jdbc.Driver
6 | username: root
7 | password: 123456
8 | url: jdbc:mysql://localhost:3306/spring_cloud?useSSL=false&useUnicode=true&characterEncoding=UTF-8
9 | redis:
10 | host: 127.0.0.1
11 | cloud:
12 | dataflow:
13 | features:
14 | skipper-enabled: false
15 | server:
16 | port: 9393
17 |
--------------------------------------------------------------------------------
/cloud-gateway/README.md:
--------------------------------------------------------------------------------
1 | Spring Cloud Gateway
2 | ====================
3 |
4 | GETTING STARTED: https://spring.io/guides/gs/gateway/
5 |
6 | # References
7 |
8 | * Spring Cloud Gateway: https://cloud.spring.io/spring-cloud-gateway/
9 |
10 |
--------------------------------------------------------------------------------
/cloud-gateway/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.mvnsearch
7 | spring-boot-microservices
8 | 1.0.0-SNAPSHOT
9 |
10 | cloud-gateway
11 | 1.0.0-SNAPSHOT
12 | jar
13 |
14 | cloud gateway
15 | Spring Cloud Gateway
16 |
17 |
18 |
19 | org.springframework.cloud
20 | spring-cloud-gateway-mvc
21 |
22 |
23 | org.springframework.boot
24 | spring-boot-starter-actuator
25 |
26 |
27 | org.springframework.boot
28 | spring-boot-starter-web
29 |
30 |
31 | org.springframework.boot
32 | spring-boot-starter-test
33 | test
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 | org.springframework.cloud
42 | spring-cloud-gateway
43 | 1.0.3.RELEASE
44 | pom
45 | import
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/cloud-gateway/src/main/java/org/mvnsearch/gateway/CloudGatewayApplication.java:
--------------------------------------------------------------------------------
1 | package org.mvnsearch.gateway;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 | import org.springframework.cloud.gateway.mvc.ProxyExchange;
6 | import org.springframework.http.ResponseEntity;
7 | import org.springframework.web.bind.annotation.GetMapping;
8 | import org.springframework.web.bind.annotation.RestController;
9 |
10 | @SpringBootApplication
11 | @RestController
12 | public class CloudGatewayApplication {
13 |
14 | public static void main(String[] args) {
15 | SpringApplication.run(CloudGatewayApplication.class, args);
16 | }
17 |
18 | @GetMapping("/test")
19 | public ResponseEntity> proxy(ProxyExchange