Skip to content

Conversation

@tomekl007
Copy link

…22901

@adutra
Copy link

adutra commented Aug 21, 2020

I'm still seeing lots of checkstyle errors, could you please run ./gradlew formatMain formatTest checkstyleMain checkstyleTest and fix the errors?

return builder.build();
}

private ReactiveSessionCallback<Metadata> extractMetadata() {
Copy link

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).

Copy link
Author

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

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Then you should do the same for buildHealth – why is it not returning Mono<Health>?
  2. Make this method protected please.

Copy link
Author

@tomekl007 tomekl007 Aug 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. buildHealth is invoked in the map() on Flux therefore it does not need to return Mono (and shouldn't)
    ReactiveSessionCallback has Publisher<T> doInSession so it must return Flux or Mono. Why do you want to make the buildHealth return mono?

Copy link

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 :-)

Copy link
Author

@tomekl007 tomekl007 Aug 21, 2020

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.

@tomekl007 tomekl007 requested a review from adutra August 21, 2020 14:04
@tomekl007
Copy link
Author

I'm still seeing lots of checkstyle errors, could you please run ./gradlew formatMain formatTest checkstyleMain checkstyleTest and fix the errors?

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants