-
Notifications
You must be signed in to change notification settings - Fork 320
Adds the option to use a pre configured RSocketRequester #498
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
Adds the option to use a pre configured RSocketRequester #498
Conversation
@iromu Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
@iromu Thank you for signing the Contributor License Agreement! |
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 challenge with accepting a fully built RSocketRequester
is that it becomes mutually exclusive with all other builder methods. So you have to prepare your requester externally and bypass the builder essentially.
I think it would be better if we exposed the same as what is available on the RSocketRequester.Builder
since RSocketGraphQlClient.Builder
is meant to be just a convenience wrapper around it. In other words:
interface Builder<B extends Builder<B>> extends GraphQlClient.Builder<B> {
// ...
B transports(Publisher<List<LoadbalanceTarget>> targetPublisher, LoadbalanceStrategy loadbalanceStrategy);
}
Do you want to rework the PR along those lines, or otherwise I can also take it from here?
I agree it is an edge case that an application will reuse a RSocketRequester. The code works, the only problem I saw was having to set a Json Decoder by default. Adding transports as a builder method looks more aligned with the current code. Let me update the PR to see how the code will look like. |
It does looks better.
|
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.
Mostly good.
There is a small detail missing, that the loadbalance details will need to be passed to the DefaultRSocketGraphQlClient
and then used in the mutate
method, or otherwise mutate
wouldn't work well if used. That's relatively minor though. I could take it from here.
Feel free to take it from here and apply any styling preference. |
This PR adds support to reuse a RSocketRequester object, with the purpose of reusing its load balancing features, and to avoid duplicating code in case the applciations uses GraphQL over RSocket and RSocket clients.
As described on Issue #497