Spring Cloud Stream 应用程序自定义属性未显示在 Cloud Data Flow 中 UI

Spring Cloud Stream App Custom Properties not showing up in Cloud Data Flow UI

创建了具有自定义属性的处理器应用程序。应用程序属性已列入白名单。在将应用程序注册到 Spring 云数据流时,自定义属性未显示在应用程序属性 UI 页面中。

-------------------------------------------------
@EnableBinding(Processor.class)
@EnableConfigurationProperties(CustomProperties.class)
@SpringBootApplication
public class CustomProcessorApplication {

    @Autowired
    private CustomProperties processorProperties;

---------------------------------------------------------

import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties
public class CustomProperties {

---------------------------------------------------------
Entry in src/main/resources/META-INF/dataflow-configuration-metadata-whitelist.properties
configuration-properties.classes=io.spring.dataflow.file.item.CustomProperties

---------------------------------------------------------
Entry in src/main/resourcesMETA-INF/spring-configuration-metadata-whitelist.properties
configuration-properties.classes=io.spring.dataflow.file.item.CustomProperties

您需要spring-boot-configuration-processor,例如

<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-configuration-processor</artifactId>
</dependency>

此外,如果您使用的是 SCDF 2.6 或更高版本,dataflow-configuration-metadata-whitelist.properties 已弃用,取而代之的是 dataflow-configuration-metadata.properties