Skip to content

Commit

Permalink
feat : expand yml properties
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadilipkolli committed Nov 16, 2023
1 parent 590be6c commit 8daba86
Show file tree
Hide file tree
Showing 6 changed files with 156 additions and 121 deletions.
5 changes: 3 additions & 2 deletions api-gateway/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/**
Expand Down
21 changes: 16 additions & 5 deletions config-server/src/main/resources/config-repository/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
202 changes: 105 additions & 97 deletions config-server/src/main/resources/config-repository/catalog-service.yml
Original file line number Diff line number Diff line change
@@ -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
31 changes: 18 additions & 13 deletions inventory-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 3 additions & 1 deletion order-service/src/main/resources/application-h2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
14 changes: 11 additions & 3 deletions order-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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/

0 comments on commit 8daba86

Please sign in to comment.