-
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
I have a little suggestion about httpclient #208
Comments
I do not understand fully what you want to do. At the moment I do not plan to change how the HttpClient works! However you can do whatever you want with Ocleot because all of its service are registered with TryAdd which means if you have already added the interface and implementation .net will not try to do it again. This means that you can override any of the services. IHttpRequester is responsible for returning the HttpResponseMessage to the Ocelot pipeline. Therefore you can provide your own implementation of this interface and register is before adding the ocelot services. e.g. services.AddJakeyHttpClient();
services.AddOcelot(); Alternatively if you want to contribute to Ocelot you could change HttpClientHttpRequester to take IHttpClientBuilder as a dependency and rather than new up HttpClientBuilder and override this. I hope this helps. |
@TomPallister
now I need to take HttpTracingDelegatingHandler join in HttpClient var _handlers = new Dictionary<int, Func>(); |
I need http tracing . including all services and ocelot |
@jakey188 OK we might be able to expose the handlers dictionary? I can have a look at this at some point in the future. However if you need tracing @geffzhang is looking into using distributed tracing butterfly in this issue #19 so that might be better? |
yes ,we might be able to expose the handlers dictionary for use butterfly . |
@jakey188 You can add me wechat geffzhang. I have added Httptracingdelegatinghandler https://github.com/geffzhang/Ocelot/blob/Monitoring/src/Ocelot/Tracing/OcelotHttpTracingHandler.cs , have basically completed and butterfly integration work, but there are test work and ocelot tracing buried point work to do, we can together to improve。 We are mainly here #19 to discuss this work |
@jakey188 please look at #224 this is my idea to implement your request. DelegatingHandlers now exposed... s.AddOcelot()
.AddDelegatingHandler(() => new FakeHandler())
.AddDelegatingHandler(() => new FakeHandler()); The delegating handlers are run in order of addition so FIFO if you are using QoS feature of Ocelot that will always be last. Let me know if you have any suggestions. |
thanks very much . expect you to incorporate the code into the trunk |
cool I will merge it soon |
This functionality is in version 3.0.3 |
Hi Tom
I want to have a free record, requesturl,httpmethod,network time consuming
but ocelot not customizable delegatinghandler
i want to httpclient more flexible. i will be in delegatinghandler do more anything
Is it possible to consider the implementation
The text was updated successfully, but these errors were encountered: