New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added ConditionalOnMissingBean to AutoConfiguration #2414
Added ConditionalOnMissingBean to AutoConfiguration #2414
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although fair, I'd expect a test case to validate that by defining your own AxonServerHealthIndicator
and AxonServerStatusAggregator
, you don't receive the defaults from this auto-configuration class. You can check the AxonServerActuatorAutoConfigurationTest
to see what such a test would look like.
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests look good, but we need to discuss the conditional statement based on the SimpleStatusAggregator
.
...c/main/java/org/axonframework/springboot/autoconfig/AxonServerActuatorAutoConfiguration.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After a short investigation and discussion on the specifics of StatusAggregator
instances, we're confident that only a single instance may exist within an application. As such, annotating it with ConditionalOnMissing(SimpleStatusAggregator)
should be fine.
Fixes #2411.
Add
ConditionalOnMissingBean
toAxonServerActuatorAutoConfiguration
methods to allow users to addAxonServerHealthIndicator
andAxonServerStatusAggregator
beans more easily, e.g. from third-party libraries.