Skip to content
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

GatewayDiscordClient doesn't inherit http client of ReactorResources from DiscordClient #1103

Open
RazeSoldier opened this issue Oct 26, 2022 · 0 comments
Labels
for team attention Maintainers need to investigate this issue on hold Pending work before this can continue
Milestone

Comments

@RazeSoldier
Copy link

RazeSoldier commented Oct 26, 2022

To Reproduce:

String token = "xxx";
ReactorResource resources = ReactorResources.builder().httpClient(...).build(); // customize HTTP client (e.g. proxy)
DiscordClient client = DiscordClientBuilder.create(token).setReactorResources(resources).build();
client.withGateway(xxx); // listen events

Expected Behavior:
GatewayDiscordClient defaults to using the parent ReactorResources inherited from DiscordClient.

Actual Behavior:
GatewayBootstrap will rebuild HTTP client: https://github.com/Discord4J/Discord4J/blob/dfcc9fb/core/src/main/java/discord4j/core/shard/GatewayBootstrap.java#L884-L892.
This will lost custom configuration.

Version:
3.2.3

Other:
In this case, I have to provide my GatewayReactorResources to GatewayBootstrap:

gatewayBootstrap.setGatewayReactorResources(reactorResources -> GatewayReactorResources.builder(client.getCoreResources().getReactorResources()).build())

to avoid the rebuild.

@quanticc quanticc added on hold Pending work before this can continue for team attention Maintainers need to investigate this issue labels Jun 11, 2023
@quanticc quanticc added this to the Backlog milestone Jun 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for team attention Maintainers need to investigate this issue on hold Pending work before this can continue
Projects
None yet
Development

No branches or pull requests

2 participants