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

[CONFIG] [STANDARD] [BROKER] -> Used library for injecting HttpClient into broker #84

Conversation

rafsanulhasan
Copy link

Closes #20

used dependency injection to inject HttpClient and related dependencies for each broker

Rafsanul Hasan added 4 commits March 19, 2023 22:00
Used constant strings instead of magic strings for better readability.

Removed some warnings
used dependency injection to inject broker and related dependencies
@hassanhabib
Copy link
Owner

Thank you for your contribution to this. There are definitely things here that we need to incorporate into our code before publishing our alpha release.

However, the decisions you are making here needs to align with our principles and standards.
For instance, we need to think of everything in terms of Brokers, Services, Exposers (Clients) with a common protocol between them all which are the Models.

Creating things like Handlers and DependencyInjection in it's own classes doesn't quite align with our standards.

I highly encourage you to go through the contribution links learn about The Standard, The C# Coding Standard and The Standard Team - these docs will help you tremendously have a heavy contribution in this project.

@rafsanulhasan
Copy link
Author

Delegating Handlers are extremely useful in order to intercept and put something inside the request or do logging in a cleaner and concise way. Why should brokers contain such code that could be repetitive but not the part of the core business logic? Besides it's a MS recommendation. It acts like a HttpInterceptor in Angular.

Useful Links:

@rafsanulhasan
Copy link
Author

rafsanulhasan commented Mar 22, 2023

Closes #106

Allowed consumers of Clients (Exposures) to implement

  • Retry Pattern (Retry with or without Delay: Retry N times, put delay of x between each retry)
  • Circuit Breaker Pattern with Exponential Backoff (after how many failures it should keep the circuit open and for how much time it should keep it open)
  • Timeout Pattern (request times out if the operation is not completed within the specified timeout)

*** added seconds and milliseconds as the unit to measure the durations.
*** users can use string or numbers to specify the durations: 5, "5", "5s", "5ms" (default is millisecond)

@hassanhabib
Copy link
Owner

Closing this due to inactivity

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.

MINOR FIX: PENDING New Version of RESTFulSense with HttpFactory
2 participants