Class ManagementApiConfig

java.lang.Object
energy.eddie.core.ManagementApiConfig

@Configuration public class ManagementApiConfig extends Object
This Spring Configuration modifies the embedded webserver by opening a second port for the management api. Because adding a second independent server and activating all spring boot features is error-prone (possibly using additional container scopes), the default server is used and an additional port is opened. To separate management api requests from the other ones, a HttpServletFilter is used and the management api uses a specific url prefix. The spring data repositories are also moved to the management api path.

The following configuration properties are used:

  • eddie.management.server.port=9090
  • eddie.management.server.urlprefix=management
  • spring.data.rest.basepath=${eddie.management.server.urlprefix}
See Also:
  • Constructor Details

    • ManagementApiConfig

      public ManagementApiConfig(@Value("${eddie.management.server.port}") int managementPort, @Value("${eddie.management.server.urlprefix}") String managementUrlPrefix)
  • Method Details

    • servletContainer

      @Bean public org.springframework.boot.web.servlet.server.ServletWebServerFactory servletContainer()
    • trustedEndpointsFilter

      @Bean public org.springframework.boot.web.servlet.FilterRegistrationBean<ManagementApiConfig.InternalEndpointsFilter> trustedEndpointsFilter()