This strategy sounds great to me. Abstracting the config object makes sense as well - even if just making it a factoryContext type of thing would be better.
I'm not sure that we need gateway level configurability though a default in the service definition would be good. Perhaps, the ability to override it in the topology would help testing but I would let that decision be made based on need. Considering that we haven't needed it yet, maybe we won't. Over course, you do have a MockHttpClientFactory in the patch being used but I see that it is used at the service definition level. On Tue, Sep 1, 2015 at 1:55 PM, Sumit Gupta <[email protected]> wrote: > All, > > I am seeking input/feedback for the work that is going into KNOX-593. > There is an initial patch uploaded and as can probably be gleaned fairly > quickly, the idea is to move code out from Dispatch implementations and > leverage apache common's HttpClient functionality as much as possible. > Besides the code maintenance win, this hopefully reduces the need to create > custom dispatches if we allow for HttpClient's to be pluggable. > > Therefore while undertaking this effort, there is an attempt to make the > HttpClient creation pluggable as well. Hence the new interface for > HttpClientFactory. Right now the create method on factory interface is > being passed the entire FilterConfig object. This felt odd to me from an > interface cleanliness standpoint but it was my initial stab at the > interface simply because it contained the information that the factory > would likely need. I think I would like to make a more appropriate config > object for this. > > The only pluggability mechanism in the patch is that of adding the http > client factory class name to the dispatch config in the service definition. > The question becomes, do we need an overall setting in gateway-site? Do we > need overrides at the topology level? > > For example, the dispatch config in a service definition could look like > this: > > <dispatch > http-client-factory="org.apache.hadoop.gateway.MockHttpClientFactory"/> > > Thanks in advance for the feedback. > Sumit. >
