patka / cassandra-migration

Schema migration library for Cassandra
MIT License
152 stars 47 forks source link

Does it work with spring boot 3 and java 17? #75

Closed MaximValeev closed 1 year ago

MaximValeev commented 1 year ago

I use this library with spring boot 3 and java 17. Configuration class CassandraMigrationAutoConfiguration is not initialised by spring context. Looks like it is just ignored. I have no any exception when application starts and migrations just not runs. I have used it with spring boot 2.7.5 and java 17 and it worked.

MaximValeev commented 1 year ago

Have found that spring boot 3 ignores spring.factories files. So auto-configuration CassandraMigrationAutoConfiguration doesn't work

patka commented 1 year ago

Hi, thanks for the research. I never tested it with Spring Boot 3 but that for sure is something to look into before it becomes a major issue for more people. Thanks for highlighting it, I see that I reserve some time for it in the next couple of weeks. I cannot give an ETA as currently sick kids always cross my plans.

qvistgaard commented 1 year ago

We are using this library and we are in the process of switching to spring boot 3. For our applications. I can report adding the file, with below content make is load:

src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

org.cognitor.cassandra.migration.spring.CassandraMigrationAutoConfiguration

There is another caveat though. Spring Data Cassandra changed property names, and they are no longer spring.data.cassandra. but instead spring.cassandra.. I worked around that issue by mapping it using spel like this:

spring.data.cassandra.keyspace-name=${spring.cassandra.keyspace-name}

I realized above is my own doing ;)

It might be an easy fix without to many complications. I will have a PR ready in a few minutes

patka commented 1 year ago

Thanks @qvistgaard for providing the pull request and adding this support. I just merged it. I will do some further checks and then release the new version with the update :)

patka commented 1 year ago

New release is on the way and should be available soon.