【问题标题】:Spring Dataflow not display propertiesSpring Dataflow 不显示属性
【发布时间】:2019-07-30 11:49:32
【问题描述】:

当我在 Spring Cloud Dataflow 中创建任务并在 Spring Cloud Dataflow 仪表板中编辑属性时,尽管已配置,但我只看到标准属性 label ConfigurationProperties。而且我不知道我设置错了什么。代码下方。

JobProps:

@Component
@ConfigurationProperties("job")
public class JobProps {

    private String ux;
//getter and setter
}

工作:

@Component
public class JobDoing {

    public JobDoing() {
        doing();
    }

    @Value("${job.ux:}")
    private String test;

    private static final Log logger = LogFactory.getLog(JobConfiguration.class);

    public void doing(){
            logger.info("Props: " + test);
    }
}

DemoApplication:

@EnableConfigurationProperties({JobProps.class })
@EnableTask
@SpringBootApplication
public class DemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }

}

【问题讨论】:

标签: spring-cloud-dataflow spring-properties


【解决方案1】:

您需要将应用程序的自定义配置属性列入白名单,以便 Spring Cloud Data Flow 服务器在提取和显示应用程序配置属性时获取它们。

要将配置属性列入白名单,您可以参考this 文档。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-07-10
    • 1970-01-01
    • 1970-01-01
    • 2017-10-12
    • 2013-06-01
    • 1970-01-01
    • 2021-04-06
    • 1970-01-01
    相关资源
    最近更新 更多