Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Impossible to know if underlying connection is shared or not #482

Closed
SeanFeldman opened this issue Jun 8, 2018 · 5 comments
Closed

Impossible to know if underlying connection is shared or not #482

SeanFeldman opened this issue Jun 8, 2018 · 5 comments

Comments

@SeanFeldman
Copy link
Collaborator

When clients are created, they can be instantiated with a connection-string or a connection.
The second method allows connection sharing. It is also exposed via IClientEntity.ServiceBusConnection. Unfortunately, there's no was to know if connection is owned by a client or not.

In scenarios, where a decision has to be made based on the fact that a client does or does not own a connection, there's no way to determine that information. The information is stored internally on each client, and could be exposed via IClientEntity as a read-only property.

Suggestion - expose OwnsConnection read-only property on IClientEntity for all clients to implement.

Modifying IClientEntity would cause a breaking change and require a new major version.
Alternative route would be to introduce OwnsConnection in a minor release and expose as part of the
IClientEntity interface in the next major.

Versions

  • NuGet package version or commit ID: 3.0.2
@nemakam
Copy link
Contributor

nemakam commented Jun 8, 2018

What is the real-world use case here?
You have created your own client. So you already do know which one is shared, and which one is not.

@SeanFeldman
Copy link
Collaborator Author

What is the real-world use case here?

Trying to implement MessageSender pooling and when returning a message sender back, information required to determine what to do about the returned sender is not enough.

You have created your own client. So you already do know which one is shared, and which one is not.

In an application that span a larger code base, getting a sender from a pool (creation) and returning (verification that sender owns its connection) are not necessarily related.

@SeanFeldman
Copy link
Collaborator Author

@nemakam I could send a PR if you'd like.

@nemakam
Copy link
Contributor

nemakam commented Jun 13, 2018

@SeanFeldman
Sure. So if I understand correctly, you will have to send 2 PRs. One with the property exposing in ClientEntity, which can go anytime.
Another one that would go to IClientEntity that will be checked in along with other breaking changes.

@SeanFeldman
Copy link
Collaborator Author

SeanFeldman commented Jun 13, 2018 via email

SeanFeldman added a commit to SeanFeldman/azure-service-bus-dotnet that referenced this issue Jun 14, 2018
SeanFeldman added a commit to SeanFeldman/azure-service-bus-dotnet that referenced this issue Jun 14, 2018
SeanFeldman added a commit to SeanFeldman/azure-service-bus-dotnet that referenced this issue Jun 14, 2018
SeanFeldman added a commit to SeanFeldman/azure-service-bus-dotnet that referenced this issue Jun 14, 2018
SeanFeldman added a commit to SeanFeldman/azure-service-bus-dotnet that referenced this issue Jun 14, 2018
SeanFeldman added a commit to SeanFeldman/azure-service-bus-dotnet that referenced this issue Jun 14, 2018
nemakam pushed a commit that referenced this issue Jun 18, 2018
…n string (Part 1) (#485)

Fixes #482 

- Allow clients to report if they own or share the underlying connection string.
- Remove unnecessary `ownsConnection` field from all clients

This is part 1 out of 2 parts PRs. Follow up PR #486 will be completing this change in the next major release.
SeanFeldman added a commit to SeanFeldman/azure-service-bus-dotnet that referenced this issue Jun 18, 2018
SeanFeldman added a commit to SeanFeldman/azure-service-bus-dotnet that referenced this issue Jun 22, 2018
SeanFeldman added a commit to SeanFeldman/azure-service-bus-dotnet that referenced this issue Jun 23, 2018
SeanFeldman added a commit to SeanFeldman/azure-service-bus-dotnet that referenced this issue Jun 27, 2018
SeanFeldman added a commit to SeanFeldman/azure-service-bus-dotnet that referenced this issue Jun 29, 2018
SeanFeldman added a commit to SeanFeldman/azure-service-bus-dotnet that referenced this issue Jul 18, 2018
SeanFeldman added a commit to SeanFeldman/azure-service-bus-dotnet that referenced this issue Jul 27, 2018
SeanFeldman added a commit to SeanFeldman/azure-service-bus-dotnet that referenced this issue Jul 31, 2018
SeanFeldman added a commit to SeanFeldman/azure-service-bus-dotnet that referenced this issue Aug 12, 2018
SeanFeldman added a commit to SeanFeldman/azure-service-bus-dotnet that referenced this issue Aug 24, 2018
SeanFeldman added a commit to SeanFeldman/azure-service-bus-dotnet that referenced this issue Oct 2, 2018
SeanFeldman added a commit to SeanFeldman/azure-service-bus-dotnet that referenced this issue Oct 24, 2018
SeanFeldman added a commit to SeanFeldman/azure-service-bus-dotnet that referenced this issue Nov 20, 2018
SeanFeldman added a commit to SeanFeldman/azure-service-bus-dotnet that referenced this issue Jan 11, 2019
SeanFeldman added a commit to SeanFeldman/azure-service-bus-dotnet that referenced this issue Jan 17, 2019
SeanFeldman added a commit to SeanFeldman/azure-service-bus-dotnet that referenced this issue Mar 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants