如何在Camel中使用BridgePropertyPlaceholderConfigurer前缀筛选属性



在Camel中使用@Value注释读取值时,是否有方法按属性前缀进行筛选?我使用BridgePropertyPlaceholderConfigurer来指定属性文件,并尝试在属性bean上设置@ConfigurationProperties(前缀="SlowEndpoint"(,但它似乎忽略了它。

ConfigurationProperties和Value注释不应在此场景中一起使用。在移除@Value注释之后,ConfigurationProperties注释获取了与属性bean成员命名相同的属性。

public class SlowEndpointConfiguration extends BaseHystrixConfigurationDefinition {
@Configuration
@Profile({"default", "local"})
@PropertySource("classpath:/properties/local/hystrix/SlowEndpointHystrix.properties")
@ConfigurationProperties(prefix = "SlowEndpoint")
static class Defaults extends SlowEndpointConfiguration{
}
}

相关内容

  • 没有找到相关文章

最新更新