-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cassandra RetryPolicy can't be used #48
Comments
I am not sure I get your request. About which driver version are we talking. As far as I understand it the RetryPolicy is set on the Cluster object (for version 3) and in a configuration file (for version 4). In both cases you are able to configure this. What else is needed? I never used this feature. |
At least on version 3 the RetryPolicy is a kind of callback that can be registered at the Cluster level allowing you to retry failed commands. |
I have solved it by introducing a delay after each migration. I have had to create my own MigrationTask passing it a subclass of Database that introduces a delay whenever the execute(migration) method is called. |
I already had a solution in mind to allow the execution of the statement to be somewhat more configurable. Seems the need for that is rising. I see how I can integrate this in the current version. At the moment my preferred way of doing this would be by using a Strategy that does the execution and that can be replaced with another one that does things a little different. |
Yes, that's exactly what I need: a way to replace/customize the "executeStatement" method. An example could be polling the cluster metadata to check the schema agreement instead of trusting on executionInfo to check it, |
I just created a branch called issue_48 that contains a first version with a strategy to execute statements. Could you have a look and see if that solves your issue? There might be some changes before it is finalized so please don't use it in production code already. This is just to be on the same page for the idea ;-) |
It's ok. It gives us much more flexibility when executing the migration statements. It allows us to implement it with a simple lambda so I would probably annotate the strategy interface with FunctionalInterface. `
}` |
Of course the strategy will become an option in Spring Boot. This was just to see if that solution will help you. Thanks for the highlight of the FunctionalInterface. That is actually a very good point. |
It would be great if the migration script commands would be executed in a way that the Cassandra RetryPolicy or any other retry method could be used.
The text was updated successfully, but these errors were encountered: