From 8daba8616857d9177f2f9176126c62d1e0157991 Mon Sep 17 00:00:00 2001 From: Raja Kolli Date: Thu, 16 Nov 2023 04:39:54 +0000 Subject: [PATCH] feat : expand yml properties --- .../src/main/resources/application.yml | 5 +- .../config-repository/application.yml | 21 +- .../config-repository/catalog-service.yml | 202 +++++++++--------- .../src/main/resources/application.yml | 31 +-- .../src/main/resources/application-h2.yml | 4 +- .../src/main/resources/application.yml | 14 +- 6 files changed, 156 insertions(+), 121 deletions(-) diff --git a/api-gateway/src/main/resources/application.yml b/api-gateway/src/main/resources/application.yml index 9c3afa70..9d6d65c7 100644 --- a/api-gateway/src/main/resources/application.yml +++ b/api-gateway/src/main/resources/application.yml @@ -35,8 +35,9 @@ spring: filters: - name: RequestRateLimiter args: - redis-rate-limiter.replenishRate: 60 - redis-rate-limiter.burstCapacity: 10 + redis-rate-limiter: + replenishRate: 60 + burstCapacity: 10 - id: inventory-service predicates: - Path=/inventory-service/** diff --git a/config-server/src/main/resources/config-repository/application.yml b/config-server/src/main/resources/config-repository/application.yml index 352f2685..88fe1e68 100644 --- a/config-server/src/main/resources/config-repository/application.yml +++ b/config-server/src/main/resources/config-repository/application.yml @@ -39,8 +39,12 @@ management: metrics: distribution: percentiles-histogram: - http.server.requests: true - resilience4j.circuitbreaker.calls: true + http: + server: + requests: true + resilience4j: + circuitbreaker: + calls: true endpoint: health: probes: @@ -95,15 +99,22 @@ spring: fail_on_pagination_over_collection_fetch: true in_clause_parameter_padding: true plan_cache_max_size: 4096 - session.events.log.LOG_QUERIES_SLOWER_THAN_MS: 1 + session: + events: + log: + LOG_QUERIES_SLOWER_THAN_MS: 5 # show-sql: true main: allow-bean-definition-overriding: true mvc: problemdetails: enabled: true - output.ansi.enabled: ALWAYS - threads.virtual.enabled: true + output: + ansi: + enabled: ALWAYS + threads: + virtual: + enabled: true #SpringDoc Properties springdoc: diff --git a/config-server/src/main/resources/config-repository/catalog-service.yml b/config-server/src/main/resources/config-repository/catalog-service.yml index a27aa63f..6d416566 100644 --- a/config-server/src/main/resources/config-repository/catalog-service.yml +++ b/config-server/src/main/resources/config-repository/catalog-service.yml @@ -1,98 +1,106 @@ -resilience4j.circuitbreaker: - configs: - default: - registerHealthIndicator: true - slidingWindowSize: 10 - minimumNumberOfCalls: 5 - permittedNumberOfCallsInHalfOpenState: 3 - automaticTransitionFromOpenToHalfOpenEnabled: true - waitDurationInOpenState: 5s - failureRateThreshold: 50 - eventConsumerBufferSize: 10 - recordExceptions: - - org.springframework.web.client.HttpServerErrorException - - java.util.concurrent.TimeoutException - - java.io.IOException - ignoreExceptions: - - com.example.catalogservice.exception.ProductNotFoundException - shared: - slidingWindowSize: 100 - permittedNumberOfCallsInHalfOpenState: 30 - waitDurationInOpenState: 1s - failureRateThreshold: 50 - eventConsumerBufferSize: 10 - ignoreExceptions: - - com.example.catalogservice.exception.ProductNotFoundException - instances: - default: - baseConfig: default - getInventoryByProductCodes: - baseConfig: shared -resilience4j.retry: - configs: - default: - maxAttempts: 3 - waitDuration: 100 - retryExceptions: - - org.springframework.web.client.HttpServerErrorException - - java.util.concurrent.TimeoutException - - java.io.IOException - ignoreExceptions: - - com.example.catalogservice.exception.ProductNotFoundException - instances: - default: - baseConfig: default - getInventoryByProductCodes: - baseConfig: default -resilience4j.bulkhead: - configs: - default: - maxConcurrentCalls: 100 - instances: - default: - maxConcurrentCalls: 10 - getInventoryByProductCodes: - maxWaitDuration: 10ms - maxConcurrentCalls: 20 -resilience4j.thread-pool-bulkhead: - configs: - default: - maxThreadPoolSize: 4 - coreThreadPoolSize: 2 - queueCapacity: 2 - instances: - default: - baseConfig: default - getInventoryByProductCodes: - maxThreadPoolSize: 1 - coreThreadPoolSize: 1 - queueCapacity: 1 -resilience4j.ratelimiter: - configs: - default: - registerHealthIndicator: false - limitForPeriod: 100 - limitRefreshPeriod: 1s - timeoutDuration: 0 - eventConsumerBufferSize: 100 - instances: - default: - baseConfig: default - getInventoryByProductCodes: - limitForPeriod: 6 - limitRefreshPeriod: 500ms - timeoutDuration: 3s -resilience4j.timelimiter: - configs: - default: - cancelRunningFuture: false - timeoutDuration: 2s - instances: - default: - baseConfig: default - getInventoryByProductCodes: - baseConfig: default +resilience4j: + circuitbreaker: + configs: + default: + registerHealthIndicator: true + slidingWindowSize: 10 + minimumNumberOfCalls: 5 + permittedNumberOfCallsInHalfOpenState: 3 + automaticTransitionFromOpenToHalfOpenEnabled: true + waitDurationInOpenState: 5s + failureRateThreshold: 50 + eventConsumerBufferSize: 10 + recordExceptions: + - org.springframework.web.client.HttpServerErrorException + - java.util.concurrent.TimeoutException + - java.io.IOException + ignoreExceptions: + - com.example.catalogservice.exception.ProductNotFoundException + shared: + slidingWindowSize: 100 + permittedNumberOfCallsInHalfOpenState: 30 + waitDurationInOpenState: 1s + failureRateThreshold: 50 + eventConsumerBufferSize: 10 + ignoreExceptions: + - com.example.catalogservice.exception.ProductNotFoundException + instances: + default: + baseConfig: default + getInventoryByProductCodes: + baseConfig: shared + retry: + configs: + default: + maxAttempts: 3 + waitDuration: 100 + retryExceptions: + - org.springframework.web.client.HttpServerErrorException + - java.util.concurrent.TimeoutException + - java.io.IOException + ignoreExceptions: + - com.example.catalogservice.exception.ProductNotFoundException + instances: + default: + baseConfig: default + getInventoryByProductCodes: + baseConfig: default + bulkhead: + configs: + default: + maxConcurrentCalls: 100 + instances: + default: + maxConcurrentCalls: 10 + getInventoryByProductCodes: + maxWaitDuration: 10ms + maxConcurrentCalls: 20 + thread-pool-bulkhead: + configs: + default: + maxThreadPoolSize: 4 + coreThreadPoolSize: 2 + queueCapacity: 2 + instances: + default: + baseConfig: default + getInventoryByProductCodes: + maxThreadPoolSize: 1 + coreThreadPoolSize: 1 + queueCapacity: 1 + ratelimiter: + configs: + default: + registerHealthIndicator: false + limitForPeriod: 100 + limitRefreshPeriod: 1s + timeoutDuration: 0 + eventConsumerBufferSize: 100 + instances: + default: + baseConfig: default + getInventoryByProductCodes: + limitForPeriod: 6 + limitRefreshPeriod: 500ms + timeoutDuration: 3s + timelimiter: + configs: + default: + cancelRunningFuture: false + timeoutDuration: 2s + instances: + default: + baseConfig: default + getInventoryByProductCodes: + baseConfig: default -spring.webflux.problemdetails.enabled: true -management.health.circuitbreakers.enabled: true -management.health.ratelimiters.enabled: true +spring: + webflux: + problemdetails: + enabled: true +management: + health: + circuitbreakers: + enabled: true + ratelimiters: + enabled: true diff --git a/inventory-service/src/main/resources/application.yml b/inventory-service/src/main/resources/application.yml index 01d731ef..ece4fae4 100644 --- a/inventory-service/src/main/resources/application.yml +++ b/inventory-service/src/main/resources/application.yml @@ -13,17 +13,22 @@ spring: testcontainers: beans: startup: parallel - -######## Kafka Configuration ######### -spring.kafka: + kafka: # bootstrap-servers: 127.0.0.1:9092 - consumer: - key-deserializer: org.apache.kafka.common.serialization.LongDeserializer - value-deserializer: org.springframework.kafka.support.serializer.JsonDeserializer - properties: - spring.json.trusted.packages: "com.example.common.dtos" - producer: - key-serializer: org.apache.kafka.common.serialization.LongSerializer - value-serializer: org.springframework.kafka.support.serializer.JsonSerializer - properties: - spring.json.add.type.headers: true + consumer: + key-deserializer: org.apache.kafka.common.serialization.LongDeserializer + value-deserializer: org.springframework.kafka.support.serializer.JsonDeserializer + properties: + spring: + json: + trusted: + packages: "com.example.common.dtos" + producer: + key-serializer: org.apache.kafka.common.serialization.LongSerializer + value-serializer: org.springframework.kafka.support.serializer.JsonSerializer + properties: + spring: + json: + add: + type: + headers: true diff --git a/order-service/src/main/resources/application-h2.yml b/order-service/src/main/resources/application-h2.yml index 235c526c..804334bf 100644 --- a/order-service/src/main/resources/application-h2.yml +++ b/order-service/src/main/resources/application-h2.yml @@ -10,7 +10,9 @@ spring: password: password driverClassName: org.h2.Driver jpa: - spring.jpa.database-platform: org.hibernate.dialect.H2Dialect + spring: + jpa: + database-platform: org.hibernate.dialect.H2Dialect config: import: optional:configserver:${CONFIG_SERVER:http://localhost:8888}/ application: diff --git a/order-service/src/main/resources/application.yml b/order-service/src/main/resources/application.yml index eb8c0c74..a6c40e3c 100644 --- a/order-service/src/main/resources/application.yml +++ b/order-service/src/main/resources/application.yml @@ -11,11 +11,16 @@ spring: key-serializer: org.apache.kafka.common.serialization.LongSerializer value-serializer: org.springframework.kafka.support.serializer.JsonSerializer properties: - spring.json.add.type.headers: true + spring: + json: + add: + type: + headers: true streams: clientId: order-service-stream-client replicationFactor: 1 - producer.acks: all + producer: + acks: all application-id: ${spring.application.name} properties: commit: @@ -28,5 +33,8 @@ spring: serde: org.apache.kafka.common.serialization.Serdes$LongSerde value: serde: org.springframework.kafka.support.serializer.JsonSerde - spring.json.trusted.packages: 'com.example.common.dtos' + spring: + json: + trusted: + packages: 'com.example.common.dtos' # state-dir: /tmp/kafka-streams/