Rafael
Rafael

Reputation: 185

micronaut yaml properties list

I have a list with configurations for producers:

myproject:
  process:
    article:
      topic: masterdata.product
      detail:
    supplier:
      topic: masterdata.supplier
      detail:
    others:
      topic: masterdata.others
      detail:     

is it possible to inject all topics properties into a value?

something like this

@Value("${myproject.process.*.topic}")

Regards

Upvotes: 0

Views: 731

Answers (1)

Denis
Denis

Reputation: 613

The only way would be to define an extra object:

@EachProperty(“myproject.process”)
class Process {
   String topic;
   // …
}

// then inject and collect all topics:

@Inject
List<Process> processes;

Upvotes: 0

Related Questions