Reputation: 6649
I am creating a custom Spring Boot starter that registers/activates an IntegrationFlow
. This was originally a regular project, but 60% of the customization is done by Spring Boot properties autoconfiguration on a YAML.
My problem is that when moving it to a starter, I am fearing that my importer project overrides certain configurations so the integration won't work.
How can I solve that? Basically I'd like to avoid having to create and set manually all chain of beans and dependencies that Spring Boot does for me (resttemplate
, objectmapper
, jms broker
) in fear of any possible existence in the importer project in the shape of a registered @Bean or a YAML property.
Ideally there would be a way to tell my starter autoconfigurer "ignore anything on the importer and use a private context with my YAML properties and the inferences as if importer did not exist which applies to the X,Y,Z beans that I really want to inject in the importer context given @Conditional clause".
Upvotes: 1
Views: 117
Reputation: 311
When running the process with your custom starter, there is a way to specify as argument the path to the properties/yml file, from which spring boot will create its context. This would assure you that the context will be created only using the file you explicitly given as input argument.
This would imply also for you to have separate full config file for your integration starter.
For a mix usage of yaml files, as far as my knowledge goes, spring boot can only reference one config file. Let me know if this information helps you, or if you could further develop your question maybe with some sample code of your starter.
Upvotes: 1