1

When doing R2DBC and liquibase how do you ensure Liquibase finishes first before doing any R2DBC operations?

I have a @PostConstruct which seems to get fired before Liquibase finishes.

I am thinking I just need a @DependsOn but I am not sure what to depend on.

Archimedes Trajano
  • 35,625
  • 19
  • 175
  • 265

1 Answers1

1

A liquibase bean is completed after the Liquibase finishes its run

So you just need

@Component
@DependsOn("liquibase")

Since it's a string, there's no need to load up liquibase-core as an implementation depenendecy and you can use it as a runtimeOnly dependency to save memory on your IDE.

Archimedes Trajano
  • 35,625
  • 19
  • 175
  • 265