Skip to content

rajeshkawali/Springboot-microservices-online-shopping

Repository files navigation

Springboot-microservices-online-shopping

Springboot microservices online shopping

To setup Zipkin

https://zipkin.io/pages/quickstart

  • C:\Users\rajesh> docker run -d -p 9411:9411 openzipkin/zipkin --> To download and run zipkin

  • C:\Users\rajesh> docker run -d --name zipkin -p 9411:9411 openzipkin/zipkin --> To give name to container

  • C:\Users\rajesh> docker ps --> To see running containers CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 55793af3637f openzipkin/zipkin "start-zipkin" 10 seconds ago Up 9 seconds (healthy) 9410/tcp, 0.0.0.0:9411->9411/tcp zipkin

  • C:\Users\rajesh> docker kill 55793af3637f --> To kill container using containerId

To open zipkin UI in browser:

http://localhost:9411/zipkin/

To run the docker-compose file

  • C:\Users\rajesh> docker-compose up -d -->To start docker-compose file
  • C:\Users\rajesh> docker-compose down -->To stop docker-compose file

Resilience4j configuration

  • resilience4j.circuitbreaker.instances.stock.registerHealthIndicator=true :- Registers a health indicator for the circuit breaker instance named "stock".
  • resilience4j.circuitbreaker.instances.stock.event-consumer-buffer-size=10 :- Sets the maximum number of events that the circuit breaker instance named "stock" can hold in its event buffer.
  • resilience4j.circuitbreaker.instances.stock.slidingWindowType=COUNT_BASED :- Sets the sliding window type of the circuit breaker instance named "stock" to count-based.
  • resilience4j.circuitbreaker.instances.stock.slidingWindowSize=5 :- Sets the sliding window size of the circuit breaker instance named "stock" to 5.
  • resilience4j.circuitbreaker.instances.stock.failureRateThreshold=50 :- Sets the failure rate threshold of the circuit breaker instance named "stock" to 50%.
  • resilience4j.circuitbreaker.instances.stock.waitDurationInOpenState=5s :- Sets the wait duration in the open state of the circuit breaker instance named "stock" to 5 seconds.
  • resilience4j.circuitbreaker.instances.stock.permittedNumberOfCallsInHalfOpenState=3 :- Sets the permitted number of calls in the half-open state of the circuit breaker instance named "stock" to 3.
  • resilience4j.circuitbreaker.instances.stock.automaticTransitionFromOpenToHalfOpenEnabled=true :- Enables automatic transition from open to half-open state for the circuit breaker instance named "stock".
  • resilience4j.timelimiter.instances.stock.timeout-duration=3s :- Sets the timeout duration for the time limiter instance named "stock" to 3 seconds.
  • resilience4j.retry.instances.stock.max-attempts=3 :- Sets the maximum number of retry attempts for the retry instance named "stock" to 3.
  • resilience4j.retry.instances.stock.wait-duration=5s :- Sets the wait duration between retry attempts for the retry instance named "stock" to 5 seconds.