Is it possible with Spring Java to read a string-array from a map of named values from a YAML file as a constant (specifically for use with the @KafkaListener
annotation from Spring-Kafka)?
a:
b:
topics:
foo: FooTopic
bar: BarTopic
Would result in a constant = ['FooTopic','BarTopic'].
I'm assuming it would be something similar to the expression that evaluates to a list as with some of the examples from [ Reading a List from properties file and load with spring annotation @Value ]. I'm just unsure of what the syntax might be, as the only way I've seen is using multiple annotations to construct a POJO like [ Reading a map from yaml in Java getting null ] which doesn't work in the @KafkaListener
annotation context.
Note: The topics need to be named as they are extracted individually in a different context.
Edit: spelling