Skip to content

Commit 1b6b77c

Browse files
committed
Merge branch 'release/4.9'
2 parents 7c601aa + 77c55cd commit 1b6b77c

File tree

7 files changed

+60
-60
lines changed

7 files changed

+60
-60
lines changed

store-base/store-build-chassis/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.springframework.boot</groupId>
88
<artifactId>spring-boot-starter-parent</artifactId>
9-
<version>2.3.0.M4</version>
9+
<version>2.3.0.RC1</version>
1010
<relativePath/> <!-- lookup parent from repository -->
1111
</parent>
1212

store-base/store-cloud-chassis/pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@
4747
<scope>test</scope>
4848
</dependency>
4949
<!-- End - Testing dependencies -->
50+
<!-- Start - High-performance caching library for Java used by new Spring Cloud
51+
LoadBalancer -->
52+
<dependency>
53+
<groupId>com.github.ben-manes.caffeine</groupId>
54+
<artifactId>caffeine</artifactId>
55+
</dependency>
56+
<!-- End - High-performance caching library for Java caffeine -->
5057
</dependencies>
5158

5259
<build>

store-cloud-infra/edge-server/src/main/java/com/siriusxi/cloud/infra/gateway/config/GatewayConfiguration.java

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
import java.util.Map;
1515

16+
// TODO add swagger API
1617
@Configuration
1718
@Log4j2
1819
public class GatewayConfiguration {
@@ -26,30 +27,30 @@ public GatewayConfiguration(WebClient.Builder webClientBuilder) {
2627
this.webClientBuilder = webClientBuilder;
2728
}
2829

29-
/**
30-
* This method is to check all the services health status, and Gateway service health will be
31-
* only in up health state if and only if all of the core services and dependencies are up
32-
* and running.
33-
*
34-
* @return ReactiveHealthContributor information about all the core microservices.
35-
*/
36-
@Bean(name = "Core Microservices")
37-
ReactiveHealthContributor coreServices() {
30+
/**
31+
* This method is to check all the services health status, and Gateway service health will be only
32+
* in up health state if and only if all of the core services and dependencies are up and running.
33+
*
34+
* @return ReactiveHealthContributor information about all the core microservices.
35+
*/
36+
@Bean(name = "Core Microservices")
37+
ReactiveHealthContributor coreServices() {
3838

39-
ReactiveHealthIndicator productHealthIndicator = () -> getServicesHealth("http://product");
40-
ReactiveHealthIndicator recommendationHealthIndicator = () -> getServicesHealth("http://recommendation");
41-
ReactiveHealthIndicator reviewHealthIndicator = () -> getServicesHealth("http://review");
42-
ReactiveHealthIndicator storeHealthIndicator = () -> getServicesHealth("http://store");
39+
ReactiveHealthIndicator productHealthIndicator = () -> getServicesHealth("http://product");
40+
ReactiveHealthIndicator recommendationHealthIndicator =
41+
() -> getServicesHealth("http://recommendation");
42+
ReactiveHealthIndicator reviewHealthIndicator = () -> getServicesHealth("http://review");
43+
ReactiveHealthIndicator storeHealthIndicator = () -> getServicesHealth("http://store");
4344

44-
Map<String, ReactiveHealthContributor> allIndicators =
45-
Map.of(
46-
"Product Service", productHealthIndicator,
47-
"Recommendation Service", recommendationHealthIndicator,
48-
"Review Service", reviewHealthIndicator,
49-
"Store Service",storeHealthIndicator);
45+
Map<String, ReactiveHealthContributor> allIndicators =
46+
Map.of(
47+
"Product Service", productHealthIndicator,
48+
"Recommendation Service", recommendationHealthIndicator,
49+
"Review Service", reviewHealthIndicator,
50+
"Store Service", storeHealthIndicator);
5051

51-
return CompositeReactiveHealthContributor.fromMap(allIndicators);
52-
}
52+
return CompositeReactiveHealthContributor.fromMap(allIndicators);
53+
}
5354

5455
private Mono<Health> getServicesHealth(String url) {
5556
url += "/actuator/health";

store-cloud-infra/edge-server/src/main/resources/application.yml

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,44 @@ spring:
66
cloud:
77
loadbalancer.ribbon.enabled: false
88
# Route definitions of the system
9-
gateway.routes:
10-
- id: store-products
11-
# lb:// is used to direct Spring Cloud Gateway to use the client-side load balancer
12-
# to look up the destination in the discovery service.
13-
uri: lb://store
14-
predicates:
15-
- Path=/store/**
9+
gateway:
10+
discovery.locator.enabled: true
11+
routes:
12+
- id: store-products
13+
# lb:// is used to direct Spring Cloud Gateway to use the client-side load balancer
14+
# to look up the destination in the discovery service.
15+
uri: lb://store
16+
predicates:
17+
- Path=/store/**
1618

17-
- id: eureka-api
18-
uri: http://${app.eureka-server}:8761
19-
predicates:
20-
- Path=/eureka/api/{segment}
21-
filters:
22-
- SetPath=/eureka/{segment}
19+
- id: eureka-api
20+
uri: http://${eureka.instance.hostname}:8761
21+
predicates:
22+
- Path=/eureka/api/{segment}
23+
filters:
24+
- SetPath=/eureka/{segment}
2325

24-
- id: eureka-web-start
25-
uri: http://${app.eureka-server}:8761
26-
predicates:
27-
- Path=/eureka/web
28-
filters:
29-
- SetPath=/
26+
- id: eureka-web-start
27+
uri: http://${eureka.instance.hostname}:8761
28+
predicates:
29+
- Path=/eureka/web
30+
filters:
31+
- SetPath=/
3032

31-
- id: eureka-web-other
32-
uri: http://${app.eureka-server}:8761
33-
predicates:
34-
- Path=/eureka/**
35-
36-
app.eureka-server: localhost
33+
- id: eureka-web-other
34+
uri: http://${eureka.instance.hostname}:8761
35+
predicates:
36+
- Path=/eureka/**
3737

3838
eureka:
3939
instance:
40+
hostname: localhost
4041
lease-renewal-interval-in-seconds: 5
4142
lease-expiration-duration-in-seconds: 5
4243
prefer-ip-address: true
4344
client:
4445
healthcheck.enabled: true
45-
service-Url.defaultZone: http://${app.eureka-server}:8761/eureka/
46+
service-Url.defaultZone: http://${eureka.instance.hostname}:8761/eureka/
4647
initial-instance-info-replication-interval-seconds: 5
4748
registry-fetch-interval-seconds: 5
4849

@@ -67,6 +68,5 @@ spring.profiles: docker
6768

6869
eureka:
6970
instance:
70-
prefer-ip-address: false
71-
72-
app.eureka-server: eureka
71+
hostname: eureka
72+
prefer-ip-address: false

store-cloud-infra/edge-server/src/test/java/com/siriusxi/cloud/infra/gateway/EdgeServerApplicationTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
@SpringBootTest(
1010
webEnvironment = RANDOM_PORT,
1111
properties = {"eureka.client.enabled: false"})
12-
// TODO add test cases https://spring.io/guides/gs/gateway/
1312
class EdgeServerApplicationTests {
1413

1514
@Test

store-cloud-infra/eureka-server/pom.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,5 @@
2323
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
2424
</dependency>
2525
<!-- End - Spring cloud Eureka service discovery server -->
26-
<!-- Start - High-performance caching library for Java used by new Spring Cloud
27-
LoadBalancer -->
28-
<dependency>
29-
<groupId>com.github.ben-manes.caffeine</groupId>
30-
<artifactId>caffeine</artifactId>
31-
</dependency>
32-
<!-- End - High-performance caching library for Java caffeine -->
3326
</dependencies>
3427
</project>

store-services/product-service/src/main/java/com/siriusxi/ms/store/ps/service/ProductServiceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public void deleteProduct(int productId) {
8282
.block();
8383
}
8484

85-
// TODO Cloud be added to utilities class to be used by all core services implementations.
85+
// TODO could be added to a utility class to be used by all core services implementations.
8686
private void isValidProductId(int productId) {
8787
if (productId < 1) throw new InvalidInputException("Invalid productId: " + productId);
8888
}

0 commit comments

Comments
 (0)