I am trying to run a Spring Boot Application with multiple CommandLineRunner implementations in hope, that all run methods will be started.
But it is only one of them, anyway both Implementations are created.
First:
@Component
public class TestRunnerA implements CommandLineRunner {
@Override
public void run(String... args) throws Exception {
logger.info("starting: TestRunnerA");
consume();
}
}
Second:
@Component
public class TestRunnerB implements CommandLineRunner {
@Override
public void run(String... args) throws Exception {
logger.info("starting: TestRunnerB");
consume();
}
}
In this case, only the Run()
Method of TestRunnerA
ist called.
Does somebody know why?
I tried adding a @Order
annotation, but still... (the first in the order is called)
Kind regards, Knut