cassandra-migration icon indicating copy to clipboard operation
cassandra-migration copied to clipboard

Spring Actuator support

Open rbleuse opened this issue 2 years ago • 1 comments

Hi Patrick,

I'd like to implement an actuator endpoint to check migration status, similar to https://github.com/patka/cassandra-migration/pull/39 This PR targets the v3 branch, and things changed quite a bit with the v4 driver so we can't just port this solution to the v4 branch.

Furthermore, since the session is closed after migrations, we definitely can't just create a Database bean as we can't reuse it after migrations.

The solution could be to manually re-create a Database with a custom cqlsession but that's not ideal, as it'd require to potentially create 2 identical manual sessions (one for migrations and one for actuator). Fortunately for spring-data-cassandra users with same migration keyspace as the spring-data one, we can reuse the latter one. But then, the Database class logic is to check the keyspace status and create it/create tables, which in the case of an actuator feature is useless and delay our Spring app startup as this process has already been handled by the migration (considering migrations are done before initializing the actuator bean).

Do you have an idea ?

rbleuse avatar Apr 18 '22 23:04 rbleuse

Hey Rémi

sorry for the way too long delay. Let me look into this and get back to you.

patka avatar Jan 13 '23 21:01 patka