Spring boot, how to specify the order when multiple @EventListener(ApplicationReadyEvent.class)

Viewed 608

I have a class that runs after the App starts, it has the annotation:

@EventListener(ApplicationReadyEvent.class)

Which is ok, the problem is that in my project there is a library(dependency) with the same annotation and it runs after mine, I need to specify the order/priority so the code at the dependency is executed before mine..

1 Answers

You can use @Order(value=x)

Where x = the needed order value

Related