spring boot development tips

less than 1 minute read

Common application properties

configuration to disable hystrix

There is no centralized configuration to disable hystrix. Separate configurations have to be made to disable the configuration for individual commands.

spring.cloud.circuit.breaker.enabled=false
hystrix.command.default.circuitBreaker.enabled=false

Actuator endpoints

By default, the actuator endpoints are not exposed. To expose specific ones, use maangement.endpoints.web.exposure.include to expose specific endpoints. For more details, refer to: https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-monitoring.html

management:
  health:
    redis:
      enabled: false
  endpoint:
    health:
      show-details: always
  endpoints:
    web:
      base-path: '/'
      exposure:
        include: 'info,health,metrics'
    security:
      enabled: false

Spring Boot Configuratin Binding

Enable logging

The following can be used as the jvm parameter to enable a specific logging category for spring boot application. e.g. the following enables the debug level logging for spring security.

- name: JVM_ARGS
  value: "-Dlogging.level.org.springframework.security=DEBUG"

Error handling

details of the dependencies

Go check the pom file of each starters to understand what are the exact dependencies pulled in.

Updated:

Comments