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

#552 RabbitMQ Use single connection when making use of IConnectionFactory #587

Merged
merged 1 commit into from
Jul 22, 2020
Merged

#552 RabbitMQ Use single connection when making use of IConnectionFactory #587

merged 1 commit into from
Jul 22, 2020

Conversation

mvonck
Copy link

@mvonck mvonck commented Jul 16, 2020

What this PR does / why we need it:

Current problem
Using this library via IConnectionFactory leads to new connections everytime the healthcheck url is called.

Why register via IConnectionFactory?
Because registering via IConnection leads to startup exception when rabbitMQ is not ready yet. Registering via IConnectionFactory solves this problem.

Timeline when registering via IConnection
-------- Start website> ----CRASH in DI container->----------------
---------------------------------------------------------Start RabbitMQ

Timeline when registering via IConnectionFactory
-------- Start website ---->HealthCheck 503_---->DoOtherStuff-------->HealthCheck 200----
-------------------------------------------------------Start RabbitMQ------------------------------

Which issue(s) this PR fixes:
#552 #578 #563 #480

Special notes for your reviewer:
I did't find a mocking framework so i have addes MOQ. Maybey i overlooked it?

Does this PR introduce a user-facing change?:
i don't think so

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Unit tests passing
  • End-to-end tests passing
  • Extended the documentation
  • Provided sample for the feature

@unaizorrilla
Copy link
Collaborator

I'm on review this!

@unaizorrilla unaizorrilla self-assigned this Jul 22, 2020
@unaizorrilla unaizorrilla merged commit 500770e into Xabaril:master Jul 22, 2020
@unaizorrilla
Copy link
Collaborator

Hi @mvonck

I'm sorry on delay reviewing this, merged! thanks for contribute a new release is on appveyor, when finished a new package with 3.1.3 will be available on nuget!

@mvonck
Copy link
Author

mvonck commented Jul 22, 2020

@unaizorrilla thanks for merging my pull request, but with this commit mulitple connections will be created again. The reason is because now you register the HealthCheck as transient (this is the default behavior when registering a healthceck via HealthCheckBuilder).

If you (temporary) revert the functional test i have written that detects duplicate connections, you will see that it fails.

Maybey we can rewrite that test without using MoQ? I don't have time this week, but maybey next week i can help.

@unaizorrilla
Copy link
Collaborator

True, my fault!!!

I try to revert this and release a new version now!

@unaizorrilla
Copy link
Collaborator

New release 3.1.4 is on appveyor, I'm so sorry !!

I try to add this test without using moq, let me some time to do that!

@sungam3r sungam3r mentioned this pull request Jul 30, 2023
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.

3 participants