我有 de 供应商的配置属性:
@Data
@NoArgsConstructor
@ConfigurationProperties("sybase.supplier")
public class SybaseSupplierProperties {
private short canal = 0;
private int pollSize = 10;
}
我将它注入应用程序:
@SpringBootApplication
@EnableConfigurationProperties(SybaseSupplierProperties.class)
public class SybaseSupplier {
private final DataSource dataSource;
private final SybaseSupplierProperties properties;
@Autowired
public SybaseSupplier(DataSource dataSource,
SybaseSupplierProperties properties) {
this.dataSource = dataSource;
this.properties = properties;
}
}
我有生成它的 Maven 依赖项:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
它生成为 spring-configuration-metadata.json
{
"groups": [
{
"name": "sybase.supplier",
"type": "br.com.clamed.daflow.apps.sybasesupplier.SybaseSupplierProperties",
"sourceType": "br.com.clamed.daflow.apps.sybasesupplier.SybaseSupplierProperties"
}
],
"properties": [
{
"name": "sybase.supplier.canal",
"type": "java.lang.Short",
"sourceType": "br.com.clamed.daflow.apps.sybasesupplier.SybaseSupplierProperties",
"defaultValue": 0
},
{
"name": "sybase.supplier.poll-size",
"type": "java.lang.Integer",
"sourceType": "br.com.clamed.daflow.apps.sybasesupplier.SybaseSupplierProperties",
"defaultValue": 10
}
],
"hints": []
}
应用程序属性
spring.cloud.stream.function.bindings.intControleSupplier-out-0=output
spring.cloud.function.definition=intControleSupplier
内部 maven repo 已注册。
应用程序已导入:
app register --name jdbc-sybase-supplier --type source --uri maven://br.com.clamed.cloud.dataflow.apps:jdbc-sybase-supplier:1.0.0-SNAPSHOT
当我使用它时,属性不显示:
为什么?