spring-cloud-dataflow - Spring Dataflow 不显示属性
问题描述
当我在 Spring Cloud 中创建任务Dataflow
并在 Spring Cloud 仪表板中编辑属性时,尽管已配置
,但Dataflow
我只看到标准属性。而且我不知道我设置错了什么。代码下方。label
ConfigurationProperties
工作道具:
@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);
}
}
演示应用:
@EnableConfigurationProperties({JobProps.class })
@EnableTask
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
解决方案
您需要将应用程序的自定义配置属性列入白名单,以便在提取和显示应用程序配置属性时它们被 Spring Cloud Data Flow 服务器拾取。
要将配置属性列入白名单,您可以参考此文档。
推荐阅读
- wpf - WPF 按钮内容图像 Onmouserover 更改
- html - 如何连续响应两列?在第一个文本中,在引导程序 4 中的第二个图像中
- java - 如何解决 java 8 中的“Lambdas 应该用方法引用替换”声纳问题?
- php - FCM Android 通知声音问题
- apache-kafka-streams - 关于 KTable 中抑制运算符的容错
- sql - 如何在 CASE 中执行 SELECT 语句
- java - 如何在Android的日期选择器对话框中显示所选日期的第二天日期?
- pandas - 为什么 panda 的 fillna 方法不起作用?
- java - 使用 JUnit-Tools 1.1.0 生成自动测试用例让我“选择一个测试项目”
- javascript - 仅获取 2019 年 1 月 1 日星期二 11:35:00 GMT+0530(印度标准时间)的日期,而不是原型