1

When I create Task in Spring Cloud Dataflow and edit properties in Spring Cloud Dataflow Dashboard I only see standard properties label despite being configured ConfigurationProperties. And I do not know what I've set up wrongly. Below the code.

JobProps:

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

    private String ux;
//getter and setter
}

JobDoing:

@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);
    }

}
Dvyn Resh
  • 980
  • 1
  • 6
  • 14
xampo
  • 369
  • 1
  • 7
  • 22
  • could you do it as expected? I asked this quetion https://stackoverflow.com/questions/59412806/spring-cloud-data-flow-custom-application-properties as I cannot see my custom properties – marie Dec 23 '19 at 16:33

1 Answers1

0

You need to whitelist your application's custom configuration properties so that they get picked up by the Spring Cloud Data Flow server when extracting and displaying the application configuration properties.

To whitelist the configuration properties, you can refer this documentation.

Ilayaperumal Gopinathan
  • 4,099
  • 1
  • 13
  • 12