-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
More Flexible VersionPolicy #1672
Comments
Dear Ibnu,
I'm afraid Ocelot team doesn't support outdated versions and releases. We have no separate release branch for v18 because of the lack of resources. It is pretty hard to support even the current release version because of Tom's inactivity! Finally, Pay attention that v18 (.NET 6) and v19 (.NET 7) target different .NET SDKs which can lead to different behavior of objects from |
hi, raman. we're currently waiting for dotnet 8 to be released before we upgrade all services, including the gateway that uses ocelot.
that's also our plan. i failed to mention it in my first post. thanks for the attention and cooperation in advance. |
Why did you close the issue? With 99% probability the bug exists in .NET 7 release aka v19.0.2. So, I believe we can still collaborate on your bug/issue for v18 to apply the final fix for both versions: v18 and v19. But sure, you need to understand, there will be no additional v18 release because I'm not owner to manage Ocelot efficiently. Please, reopen the issue if you have an intention to contribute soon! |
sorry, i closed this issue because i thought we reached an agreement that:
personally, i don't mind using the latest version of Ocelot. and re-opening this issue. |
+ Accepted A solution is ready in PR #1673 |
* feature written, tests passed * actualy passes almost all the test. * resolve conflict, hopefully. * please. * let it cook. * uses constants instead of string for version policies. * conflict res * swapped downstream method and version. * #1731 Read the Docs configuration file v2 (#1733) * fixing the documentation, using Release/20.0 as base branch * using latest conf.py, created with sphinx-quickstart, fixing the warnings during documentation generation * Update .readthedocs.yaml * switching to threemammals.org for copyright * adding requirements file, updating readthedocs.yaml, adding formats pdf / epub and config for requirements file * fixing code block in websockets.rst * ok, now it should be fine... * Update kubernetes.rst: Review and fix markup code * Update websockets.rst: Review and fix markup * Update conf.py: Update release, author and copyright --------- Co-authored-by: Raman Maksimchuk <dotnet044@gmail.com> * * When using the QoS option "ExceptionsAllowedBeforeBreaking" the circuit breaker never opens the circuit. * merge issue, PortFinder * some code improvements, using httpresponsemessage status codes as a base for circuit breaker * Adding more unit tests, and trying to mitigate the test issues with the method "GivenThereIsAPossiblyBrokenServiceRunningOn" * fixing some test issues * setting timeout value to 5000 to avoid side effects * again timing issues * timing issues again * ok, first one ok * Revert "ok, first one ok" This reverts commit 2e4a673. * inline method * putting back logging for http request exception * removing logger configuration, back to default * adding a bit more tests to check the policy wrap * Removing TimeoutStrategy from parameters, it's set by default to pessimistic, at least one policy will be returned, so using First() in circuit breaker and removing the branch Policy == null from delegating handler. * Fix StyleCop warnings * Format parameters * Sort usings * since we might have two policies wrapped, timeout and circuit breaker, we can't use the name CircuitBreaker for polly qos provider, it's not right. Using PollyPolicyWrapper and AsnycPollyPolicy instead. * modifying circuit breaker delegating handler name, usin Polly policies instead * renaming CircuitBreakerFactory to PolicyWrapperFactory in tests * DRY for FileConfiguration, using FileConfigurationFactory * Add copy constructor * Refactor setup * Use expression body for method * Fix acceptance test * IDE1006 Naming rule violation: These words must begin with upper case characters * CA1816 Change ReturnsErrorTests.Dispose() to call GC.SuppressFinalize(object) * Sort usings * Use expression body for method * Return back named arguments --------- Co-authored-by: raman-m <dotnet044@gmail.com> * feature written, tests passed * actualy passes almost all the test. * resolve conflict, hopefully. * missed this one. * please. * come on... * let it build. * let it cook. * copied from main branch. * conflict res * resolving conflicts. * another attempt. * lf * re-incorporate downstream version policy. * renamed the version policies and added acceptance tests. * trust the dotnet dev cert. * accepts cert from dotnet. * Fix compiling errors * Refactor tests * a bit of code cleanup, removing some usings * a bit more cleanup in fileroute * try and error with the tests * "Yahoo!...", said @ibnuda :) * FileRoute: let it go... Binary copy! :LoL: * FileRoute: let it cook... Re-add sweet props * `dotnet dev-certs` for the `build` job * Recover `kubernetes.rst` * docs/make.bat original version * OcelotBuilderExtensions * original src/Ocelot.Provider.Polly/v7/PollyPolicyWrapper.cs * `IVersionPolicyCreator` XML docs * Code review by @raman-m (part 1) * RequestMapper : care about diff * Code review by @raman-m (part 2) * Fix Should_return_OK_status_and_multiline_indented_json_response_with_json_options_for_custom_builder * Update configuration.rst Add DownstreamVersionPolicy section * Update docs * Rename `DownstreamVersionPolicy` to `DownstreamHttpVersionPolicy` * update docs after prop renaming * Sort props --------- Co-authored-by: Guillaume Gnaegi <58469901+ggnaegi@users.noreply.github.com> Co-authored-by: Raman Maksimchuk <dotnet044@gmail.com>
* feature written, tests passed * actualy passes almost all the test. * resolve conflict, hopefully. * please. * let it cook. * uses constants instead of string for version policies. * conflict res * swapped downstream method and version. * #1731 Read the Docs configuration file v2 (#1733) * fixing the documentation, using Release/20.0 as base branch * using latest conf.py, created with sphinx-quickstart, fixing the warnings during documentation generation * Update .readthedocs.yaml * switching to threemammals.org for copyright * adding requirements file, updating readthedocs.yaml, adding formats pdf / epub and config for requirements file * fixing code block in websockets.rst * ok, now it should be fine... * Update kubernetes.rst: Review and fix markup code * Update websockets.rst: Review and fix markup * Update conf.py: Update release, author and copyright --------- Co-authored-by: Raman Maksimchuk <dotnet044@gmail.com> * * When using the QoS option "ExceptionsAllowedBeforeBreaking" the circuit breaker never opens the circuit. * merge issue, PortFinder * some code improvements, using httpresponsemessage status codes as a base for circuit breaker * Adding more unit tests, and trying to mitigate the test issues with the method "GivenThereIsAPossiblyBrokenServiceRunningOn" * fixing some test issues * setting timeout value to 5000 to avoid side effects * again timing issues * timing issues again * ok, first one ok * Revert "ok, first one ok" This reverts commit 2e4a673. * inline method * putting back logging for http request exception * removing logger configuration, back to default * adding a bit more tests to check the policy wrap * Removing TimeoutStrategy from parameters, it's set by default to pessimistic, at least one policy will be returned, so using First() in circuit breaker and removing the branch Policy == null from delegating handler. * Fix StyleCop warnings * Format parameters * Sort usings * since we might have two policies wrapped, timeout and circuit breaker, we can't use the name CircuitBreaker for polly qos provider, it's not right. Using PollyPolicyWrapper and AsnycPollyPolicy instead. * modifying circuit breaker delegating handler name, usin Polly policies instead * renaming CircuitBreakerFactory to PolicyWrapperFactory in tests * DRY for FileConfiguration, using FileConfigurationFactory * Add copy constructor * Refactor setup * Use expression body for method * Fix acceptance test * IDE1006 Naming rule violation: These words must begin with upper case characters * CA1816 Change ReturnsErrorTests.Dispose() to call GC.SuppressFinalize(object) * Sort usings * Use expression body for method * Return back named arguments --------- Co-authored-by: raman-m <dotnet044@gmail.com> * feature written, tests passed * actualy passes almost all the test. * resolve conflict, hopefully. * missed this one. * please. * come on... * let it build. * let it cook. * copied from main branch. * conflict res * resolving conflicts. * another attempt. * lf * re-incorporate downstream version policy. * renamed the version policies and added acceptance tests. * trust the dotnet dev cert. * accepts cert from dotnet. * Fix compiling errors * Refactor tests * a bit of code cleanup, removing some usings * a bit more cleanup in fileroute * try and error with the tests * "Yahoo!...", said @ibnuda :) * FileRoute: let it go... Binary copy! :LoL: * FileRoute: let it cook... Re-add sweet props * `dotnet dev-certs` for the `build` job * Recover `kubernetes.rst` * docs/make.bat original version * OcelotBuilderExtensions * original src/Ocelot.Provider.Polly/v7/PollyPolicyWrapper.cs * `IVersionPolicyCreator` XML docs * Code review by @raman-m (part 1) * RequestMapper : care about diff * Code review by @raman-m (part 2) * Fix Should_return_OK_status_and_multiline_indented_json_response_with_json_options_for_custom_builder * Update configuration.rst Add DownstreamVersionPolicy section * Update docs * Rename `DownstreamVersionPolicy` to `DownstreamHttpVersionPolicy` * update docs after prop renaming * Sort props --------- Co-authored-by: Guillaume Gnaegi <58469901+ggnaegi@users.noreply.github.com> Co-authored-by: Raman Maksimchuk <dotnet044@gmail.com>
New Feature
Configurable
HttpRequestMessage.VersionPolicy
.Motivation for New Feature
The following setup:
All components above configured to use Kestrel with the following snippet:
All components above should only talk to each other using HTTP/2 and no TLS (plain HTTP).
User Scenario
With plain Ocelot 18.0.0, I couldn't make them talk to each other with plain HTTP from frontend to the service.
The services will print out error messages like the following:
Solution
Found out that I need to make sure that
HttpRequestMessage
has itsVersionPolicy
to be setRequestVersionOrHigher
.Changes I made
Ocelot.Request.Mapper
class:
RequestMapper
method:
Task<Response<HttpRequestMessage>> Map(HttpRequest request, DownstreamRoute downstreamRoute)
changes:
VersionPolicy = HttpVersionPolicy.RequestVersionOrHigher,
inHttpRequestMessage
instantiation.Ocelot.Requester
class:
HttpClientBuilder
method:
IHttpClient Create(DownstreamRoute downstreamRoute)
changes:
DefaultRequestVersion = downstreamRoute.DownstreamHttpVersion,
andDefaultVersionPolicy = HttpVersionPolicy.RequestVersionOrHigher,
inHttpClient
instantiation.Then all those components above can talk to each other in HTTP/2.
And I think
DefaultVersionPolicy = HttpVersionPolicy.RequestVersionOrHigher
could beDefaultVersionPolicy downstreamRoute.DownstreamHttpVersionPolicy
.And I am willing to make a PR if you fine folks think this kind of changes is welcome.
Specifications
The text was updated successfully, but these errors were encountered: