Skip to content

Allow injecting dynamic config to ApolloConfigChangeListener #7

@anandjoshisn

Description

@anandjoshisn

Is your feature request related to a problem? Please describe.
The annotation ApolloConfigChangeListener takes an array of string (values = String []), which means if I have some namespaces defined in an application.yaml as comma separated values, I can't inject it as it needs to be constant.

Describe the solution you'd like
Either of the two solutions are fine

  1. Allow spring expression evaluation. eg - @ApolloConfigChangeListener("#{'${prop.apollo.namespaces:}'.split(',')}")
  2. Provide an optional argument. eg - @ApolloConfigChangeListener(namespaces = "${prop.apollo.namespaces}")

Here my application.yaml would be

prop:
  apollo:
    namespaces: "foo,bar,other-namespace"

PS - I can share a sample PR if I can have permission on this repo.

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