I'm trying to retrieve the configuration from following yaml where I have some nested arrays
ems:
filtered-queue:
- filter-regular-expressions:
- AAA*MD1
- AAA*MD2
destination-queue-names:
- ems.omie1
- ems.aws1
- filter-regular-expressions:
- BBB*MD1
- BBB*MD2
destination-queue-names:
- ems.omie2
- ems.aws2
I've double checked and there a no indentation issues. The ConfigServer is reading the file properly.
My current code to retrieve the configuration is as follows
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
import org.springframework.context.annotation.Configuration;
@Data
@Configuration
@ConfigurationProperties(prefix="ems")
public class FilteredQueueConfiguration {
@NestedConfigurationProperty
private List<FilteredQueue> filteredQueue = new ArrayList<>();
@Data
public class FilteredQueue {
private List<String> filterRegularExpressions = new ArrayList<>();
private List<String> destinationQueuenames = new ArrayList<>();
}
}
In my main class I have the @EnableConfigurationProperties(FilteredQueueConfiguration.class) annotation
I have always the same exception abound Binding to target ... failed. Any clue of what I'm doing wrong?