Skip to content

Conditional beans include support in commons-spring #431

Closed
@mhawryluk

Description

@mhawryluk

Would be cool if there was an option to include other bean files in HOCON based on a specified condition, so certain functionalities could be disabled via a feature flag and then unnecessary beans would not be built. Similar thing can be achieved by just choosing to include a file or not instead of setting a boolean feature flag, however it's not an ideal approach as it tangles configuration with Dependency Injection.

It could look something like this:

beans {
  ...
}

conditional = [
  {condition: ${ump.feature.enabled}, beans: {include "feature.conf"}},
  {condition: ${ump.coolStuff.enabled}, beans: {include "coolStuff.conf"}}
] 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions