-
Notifications
You must be signed in to change notification settings - Fork 0
Improve CassandraHealthIndicator with more robust mechanism #3
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
base: master
Are you sure you want to change the base?
Conversation
...src/main/java/org/springframework/boot/actuate/cassandra/CassandraDriverHealthIndicator.java
Outdated
Show resolved
Hide resolved
.../java/org/springframework/boot/actuate/cassandra/CassandraDriverReactiveHealthIndicator.java
Outdated
Show resolved
Hide resolved
.../java/org/springframework/boot/actuate/cassandra/CassandraDriverReactiveHealthIndicator.java
Outdated
Show resolved
Hide resolved
...uator/src/main/java/org/springframework/boot/actuate/cassandra/CassandraHealthIndicator.java
Outdated
Show resolved
Hide resolved
...c/main/java/org/springframework/boot/actuate/cassandra/CassandraReactiveHealthIndicator.java
Outdated
Show resolved
Hide resolved
|
I'm still seeing lots of checkstyle errors, could you please run |
...c/main/java/org/springframework/boot/actuate/cassandra/CassandraReactiveHealthIndicator.java
Outdated
Show resolved
Hide resolved
| return builder.build(); | ||
| } | ||
|
|
||
| private ReactiveSessionCallback<Metadata> extractMetadata() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually prefer the non-reactive version that I suggested because it is simpler and easier to override (you only need to extract the Metadata object, without caring about wrapping the result in a Mono).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also prefer it but I think that is the point of this CassandraReactiveHealthIndicator.java.
We should use .getReactiveCqlOperations().execute and it imposes that it needs to be wrapped in the Mono
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Then you should do the same for
buildHealth– why is it not returningMono<Health>? - Make this method protected please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
buildHealthis invoked in the map() onFluxtherefore it does not need to return Mono (and shouldn't)
ReactiveSessionCallbackhasPublisher<T> doInSessionso it must return Flux or Mono. Why do you want to make thebuildHealthreturn mono?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand your logic. You told me that "the point of this CassandraReactiveHealthIndicator.java" is that all methods should return reactive types, but now you say that this method should not return a reactive type? Anyways I don't care, it's fine the way it is. Stéphane is going to rewrite everything to his taste anyways :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the problem and limitation is that we should use reactiveCassandraOperations.getReactiveCqlOperations().execute that returns the Flux so we must return reactive type from extractMetadata(), next we are just chaining operations on the Flux so I see no reason to change the buildHealth to return reactive type. I will open the public PR in that case.
done |
…22901