apollo配置String、List、Map

String

key:xxx.strParam

value:abcdef

默认值:abc

    @Value("${xxx.strParam:abc}")
    private String strParam;

List

key:xxx.listParam

value:202,203,214,216,230

默认值:1,2

    @Value("#{'${xxx.listParam:1,2}'.split(',')}")
    private List listParam;

Map

key:xxx.mapParam

value:{a:1,b:2,c:3}

默认值:{a:1}

    @Value("#{${xxx.mapParam:{a:1}}}")
    private Map mapParam;

 

你可能感兴趣的:(分布式架构基础)