Skip to content

Actuator with management.port takes the same WebMvcConfigurerAdapter #4929

Open
@kadkaz

Description

@kadkaz

The WebMvcConfigurerAdapter will be executed methods twice (addViewControllers, addResourceHandlers) if you use management.port = 9251 (for instance). There are two application contexts and they use the same WebMvcConfigurerAdapter.

That's why the same urls does not work. if you have rest api with /health for example.

I guess the good solution is don't give management (Actuators) use WebMvcConfigurerAdapter.
or found the solution to filter it out form Actuators.

server:
  port: 9250
  address: 0.0.0.0
  context-path: /path
  session-timeout: 300
management:
  port: 9251
  address: 0.0.0.0
  addApplicationContextHeader: false
  context-path: /
  security:
    enabled: false
    role: ADMIN

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions