当我在 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);
}
}