【发布时间】:2020-11-18 09:36:08
【问题描述】:
我有 de Supplier 的配置属性:
@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": []
}
application.properties
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
当我使用它时,属性不显示:
为什么?
【问题讨论】:
标签: spring-cloud-dataflow spring-cloud-dataflow-ui