-
Notifications
You must be signed in to change notification settings - Fork 55
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
Using senderOptions.connectionSupplier results in multiple connections created by the Sender #93
Comments
The client-provided I think I get the idea of being able to choose the connection to use based on a name, on channel creation, but I'm not sure I understand how the name to use would be picked up (as channel creation happens inside the sender and not in client code). |
Let me clarify my use case. I want to be able to provide a custom connection name. The easiest way to do that currently is to provide a custom
I noticed that after I did that, I "lost" the default behavior that the Receiver provides. Specifically, I lost:
One of the side-effects of losing this behavior, is that a new connection is opened for each channel (since caching was lost). I feel like if only In my case, I have worked around this problem by providing a custom At a minimum, usage of |
This makes sense and can be fixed by propagating the connection supplier to the sender constructor like you suggest. Documentation should be clarified as well. |
And clarify connection supplier vs Mono<Connection> usage in documentation. References #93
If I specify a senderOptions.connectionSupplier in order to provide a connection name, then the Sender is opening a new connection for each new channel, instead of reusing the same connection for each channel. When I do not specify a connectionSupplier, only one connection is opened.
If a connectionSupplier is not specified, then the Sender constructs a custom connectionMono that caches the connection result (meaning that the same connection will always be used for each subscription). See here.
If a connectionSupplier is specified, the senderOptions.connectionMono is non-null (and not cached). Therefore a new connection is created for each subscription. I believe this means that a new connection is created for every channel here
Ideally, I would like the ability to specify a connection name via a channelSupplier, and still only have one connection created, instead of one per channel)
In addition, I'm a little concerned about not having the other default behavior that Sender adds to the connectionMono when specifying a connectionSupplier.
The text was updated successfully, but these errors were encountered: