1

I want to create a Spring cloud task application (with @EnableTask) that saves its output to a relational database but at the same time I dont want it to save metadata for taskExecution on my database. I want to force it to always use in-memory map for its internal task metadata.

Is there a way to achieve this?

Aldeguer
  • 821
  • 9
  • 32

1 Answers1

3

I found a way to achieve this by manually initializing DefaultTaskConfigurer bean and passing null value to its dataSource. See below:

   @Bean
   @Primary
   DefaultTaskConfigurer taskConfigurer() {
        DefaultTaskConfigurer taskConfigurer = new 
        DefaultTaskConfigurer(null, TaskProperties.DEFAULT_TABLE_PREFIX);
        return taskConfigurer;
    }