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

Only open the admin connection when we need to use it #71

Merged
merged 1 commit into from
Feb 6, 2015

Conversation

andreasohlund
Copy link
Member

Endpoints keeps the admin connection (to perform sub/unsubscribe) open. This is wasteful since all subscribes usually happens on start up.

@andreasohlund andreasohlund added this to the 2.1.0 milestone Jan 10, 2015
@johnsimons
Copy link
Member

Looks good

On Sunday, January 11, 2015, Andreas Öhlund notifications@github.com
wrote:

@johnsimons https://github.com/johnsimons I noticed that all endpoints
keep the admin connection (to perform sub/unsubscribe) open. This seems
wasteful since all subscribes usually happens on start up.

What do you think?

You can merge this Pull Request by running

git pull https://github.com/Particular/NServiceBus.RabbitMQ open-admin-connection-on-demand

Or view, comment on, or merge it at:

#71
Commit Summary

  • Only open the admin connection when we need to use it

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#71.

@andreasohlund
Copy link
Member Author

The issue is that we're now mixing the responsibility for disposing the
connection. Lets talk it through in the bar in Cyprus

On Sun, Jan 11, 2015 at 12:30 AM, John Simons notifications@github.com
wrote:

Looks good

On Sunday, January 11, 2015, Andreas Öhlund notifications@github.com
wrote:

@johnsimons https://github.com/johnsimons I noticed that all
endpoints
keep the admin connection (to perform sub/unsubscribe) open. This seems
wasteful since all subscribes usually happens on start up.

What do you think?

You can merge this Pull Request by running

git pull https://github.com/Particular/NServiceBus.RabbitMQ
open-admin-connection-on-demand

Or view, comment on, or merge it at:

#71
Commit Summary

  • Only open the admin connection when we need to use it

File Changes

(7)

(6)

Patch Links:


Reply to this email directly or view it on GitHub
#71.


Reply to this email directly or view it on GitHub
#71 (comment)
.

@andreasohlund
Copy link
Member Author

@johnsimons @SimonCropp while I think the fix is good (no need to keep the admin channel open) I have a bad feeling about the RabbitMqConnectionManager class. It seems wrong that some calls returns a connection that is managed by the connection manager (publish + consume) and one (admin) that is supposed to be managed by the caller. Do U have any idea on how to clean this up?

@johnsimons
Copy link
Member

@andreasohlund how about making the API more explicit?

  • GetPublishConnection rename to GetOrCreatePublishConnection
  • GetConsumeConnection rename to GetOrCreateConsumeConnection
  • GetAdministrationConnection rename to CreateAdministrationConnection

@andreasohlund
Copy link
Member Author

Yes that is better. Since it would be a breaking change I'll raise a new
issue to track it and slate if for v 3.0.0

On Fri, Feb 6, 2015 at 6:09 AM, John Simons notifications@github.com
wrote:

@andreasohlund https://github.com/andreasohlund how about making the
API more explicit?

  • GetPublishConnection rename to GetOrCreatePublishConnection
  • GetConsumeConnection rename to GetOrCreateConsumeConnection
  • GetAdministrationConnection rename to CreateAdministrationConnection


Reply to this email directly or view it on GitHub
#71 (comment)
.

andreasohlund added a commit that referenced this pull request Feb 6, 2015
Only open the admin connection when we need to use it
@andreasohlund andreasohlund merged commit 0d51580 into develop Feb 6, 2015
@andreasohlund andreasohlund deleted the open-admin-connection-on-demand branch February 6, 2015 16:27
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.

None yet

2 participants