From c9a1675aefe34d959d7585390e8e87d38d89e3a5 Mon Sep 17 00:00:00 2001 From: Mohamed Taman Date: Tue, 5 May 2020 12:47:42 +0200 Subject: [PATCH] Migrating back to Spring boot 2.3.0.RC1 - added server.error.include-message: always solves the problem of empty message. --- store-base/store-build-chassis/pom.xml | 2 +- ...ServerApplication.java => EdgeServer.java} | 4 +- .../src/main/resources/application.yml | 5 +++ ...icationTests.java => EdgeServerTests.java} | 2 +- .../src/main/resources/application.yml | 7 +++- .../src/main/resources/application.yml | 3 ++ .../src/main/resources/application.yml | 3 ++ .../src/main/resources/application.yaml | 41 +++++++++++-------- .../src/main/resources/application.yml | 6 ++- 9 files changed, 49 insertions(+), 24 deletions(-) rename store-cloud-infra/edge-server/src/main/java/com/siriusxi/cloud/infra/gateway/{EdgeServerApplication.java => EdgeServer.java} (84%) rename store-cloud-infra/edge-server/src/test/java/com/siriusxi/cloud/infra/gateway/{EdgeServerApplicationTests.java => EdgeServerTests.java} (92%) diff --git a/store-base/store-build-chassis/pom.xml b/store-base/store-build-chassis/pom.xml index 289f76ec..542705c1 100644 --- a/store-base/store-build-chassis/pom.xml +++ b/store-base/store-build-chassis/pom.xml @@ -6,7 +6,7 @@ org.springframework.boot spring-boot-starter-parent - 2.3.0.M4 + 2.3.0.RC1 diff --git a/store-cloud-infra/edge-server/src/main/java/com/siriusxi/cloud/infra/gateway/EdgeServerApplication.java b/store-cloud-infra/edge-server/src/main/java/com/siriusxi/cloud/infra/gateway/EdgeServer.java similarity index 84% rename from store-cloud-infra/edge-server/src/main/java/com/siriusxi/cloud/infra/gateway/EdgeServerApplication.java rename to store-cloud-infra/edge-server/src/main/java/com/siriusxi/cloud/infra/gateway/EdgeServer.java index cf694273..bbe7670b 100644 --- a/store-cloud-infra/edge-server/src/main/java/com/siriusxi/cloud/infra/gateway/EdgeServerApplication.java +++ b/store-cloud-infra/edge-server/src/main/java/com/siriusxi/cloud/infra/gateway/EdgeServer.java @@ -7,7 +7,7 @@ import org.springframework.web.reactive.function.client.WebClient; @SpringBootApplication -public class EdgeServerApplication { +public class EdgeServer { @Bean @LoadBalanced @@ -16,7 +16,7 @@ public WebClient.Builder loadBalancedWebClientBuilder() { } public static void main(String[] args) { - SpringApplication.run(EdgeServerApplication.class, args); + SpringApplication.run(EdgeServer.class, args); } } diff --git a/store-cloud-infra/edge-server/src/main/resources/application.yml b/store-cloud-infra/edge-server/src/main/resources/application.yml index 07bc1ca9..bb2509d9 100644 --- a/store-cloud-infra/edge-server/src/main/resources/application.yml +++ b/store-cloud-infra/edge-server/src/main/resources/application.yml @@ -35,6 +35,11 @@ spring: predicates: - Path=/eureka/** +server: + error: + include-message: always + include-binding-errors: always + eureka: instance: hostname: localhost diff --git a/store-cloud-infra/edge-server/src/test/java/com/siriusxi/cloud/infra/gateway/EdgeServerApplicationTests.java b/store-cloud-infra/edge-server/src/test/java/com/siriusxi/cloud/infra/gateway/EdgeServerTests.java similarity index 92% rename from store-cloud-infra/edge-server/src/test/java/com/siriusxi/cloud/infra/gateway/EdgeServerApplicationTests.java rename to store-cloud-infra/edge-server/src/test/java/com/siriusxi/cloud/infra/gateway/EdgeServerTests.java index b83f2ec8..d92057ef 100644 --- a/store-cloud-infra/edge-server/src/test/java/com/siriusxi/cloud/infra/gateway/EdgeServerApplicationTests.java +++ b/store-cloud-infra/edge-server/src/test/java/com/siriusxi/cloud/infra/gateway/EdgeServerTests.java @@ -9,7 +9,7 @@ @SpringBootTest( webEnvironment = RANDOM_PORT, properties = {"eureka.client.enabled: false"}) -class EdgeServerApplicationTests { +class EdgeServerTests { @Test void contextLoads() { diff --git a/store-cloud-infra/eureka-server/src/main/resources/application.yml b/store-cloud-infra/eureka-server/src/main/resources/application.yml index 028e16ae..cf9cb2b4 100644 --- a/store-cloud-infra/eureka-server/src/main/resources/application.yml +++ b/store-cloud-infra/eureka-server/src/main/resources/application.yml @@ -5,7 +5,12 @@ spring: # It is recommended switching to BlockingLoadBalancerClient instead. cloud.loadbalancer.ribbon.enabled: false -server.port: 8761 +server: + port: 8761 + ## Should be included to show message, if not error message will be empty + error: + include-message: always + include-binding-errors: always logging.level: com.netflix: diff --git a/store-services/product-service/src/main/resources/application.yml b/store-services/product-service/src/main/resources/application.yml index f08d3a24..3fc64d9a 100644 --- a/store-services/product-service/src/main/resources/application.yml +++ b/store-services/product-service/src/main/resources/application.yml @@ -45,6 +45,9 @@ spring: server: port: 9081 + error: + include-message: always + include-binding-errors: always logging.level: web: DEBUG diff --git a/store-services/recommendation-service/src/main/resources/application.yml b/store-services/recommendation-service/src/main/resources/application.yml index 6eca9745..1f7bc149 100644 --- a/store-services/recommendation-service/src/main/resources/application.yml +++ b/store-services/recommendation-service/src/main/resources/application.yml @@ -44,6 +44,9 @@ spring: server: port: 9082 + error: + include-message: always + include-binding-errors: always logging.level: web: DEBUG diff --git a/store-services/review-service/src/main/resources/application.yaml b/store-services/review-service/src/main/resources/application.yaml index 7f42d6f7..f8fbff98 100644 --- a/store-services/review-service/src/main/resources/application.yaml +++ b/store-services/review-service/src/main/resources/application.yaml @@ -5,8 +5,8 @@ spring: open-in-view: false database: MYSQL properties.hibernate.dialect: org.hibernate.dialect.MySQL8Dialect - # Strongly recommend to set this property to "none" or with flyway to "validate" in a - # production environment! + # Strongly recommend to set this property to "none" or with flyway to "validate" in a + # production environment! hibernate.ddl-auto: none datasource: ## You often do not need to specify the driver-class-name, @@ -41,13 +41,13 @@ spring: defaultBinder: rabbit default.contentType: application/json bindings.input: - destination: reviews - group: reviewsGroup - consumer: - maxAttempts: 3 - backOffInitialInterval: 500 - backOffMaxInterval: 1000 - backOffMultiplier: 2.0 + destination: reviews + group: reviewsGroup + consumer: + maxAttempts: 3 + backOffInitialInterval: 500 + backOffMaxInterval: 1000 + backOffMultiplier: 2.0 rabbit.bindings.input.consumer: autoBindDlq: true republishToDlq: true @@ -66,16 +66,20 @@ app: rabbitmq.host: 127.0.0.1 kafka.broker: 127.0.0.1 -server.port: 9083 +server: + port: 9083 + error: + include-message: always + include-binding-errors: always logging.level: - web: DEBUG - root: INFO - com.siriusxi.ms.store: DEBUG - org: - hibernate: - SQL: DEBUG - type.descriptor.sql.BasicBinder: TRACE + web: DEBUG + root: INFO + com.siriusxi.ms.store: DEBUG + org: + hibernate: + SQL: DEBUG + type.descriptor.sql.BasicBinder: TRACE management: info.git: @@ -108,7 +112,8 @@ spring: datasource: url: "jdbc:mysql://${app.database.host}/${app.database.schema}" -server.port: 8080 +server: + port: 8080 eureka: instance: diff --git a/store-services/store-service/src/main/resources/application.yml b/store-services/store-service/src/main/resources/application.yml index 3e13552c..8f6e4720 100644 --- a/store-services/store-service/src/main/resources/application.yml +++ b/store-services/store-service/src/main/resources/application.yml @@ -1,5 +1,9 @@ # Server configs -server.port: 9080 +server: + port: 9080 + error: + include-message: always + include-binding-errors: always spring: application.name: store