You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
how is PartialServiceConfiguration class being used? #32
ClientConfiguration can be created using ServiceConfiguration and there is no easy way to convert PartialServiceConfiguration to ServiceConfiguration or vice versa even though they are pretty much identical except for the absence of security. I would like know more about how we intend to use the PartialServiceConfiguration class
EDIT: saw ServiceConfigurationFactor.propagateDefaults and answered my question above.
It'd be great if we can specify service configuration outside of service discovery without requiring ssl block. Unless we are encouraging teams to only take service configuration from service discovery?
In order to use propagateDefaults, you'd need a handle on a ServiceConfigBlock; if you have one of those, why not use ServiceConfigurationFactory#get ?
ServiceConfigBlock may not have the corresponding service config block for the PartialServiceConfiguration. I wonder if we should expose a convenient method of converting PartialServiceConfiguration to a ServiceConfiguration by filling in the defaults that are not present, which is what propagateDefaults does mostly
ServiceConfigurationFactory#get only works for services defined in the ServicesConfigBlock. In some places, we define partial service configurations outside of the service discovery block, for example workers, and event consumers. The defaults in ServicesConfigBlock should get propagated to those as well, but currently there's no good way of doing that.
I had to do this also, workaround is to build a ServicesConfigBlock with a named service and then retrieve the same service back.
protected static final PartialServiceConfiguration STATS_CONFIG =
PartialServiceConfiguration.of(Lists.newArrayList(STATS_URI + "api/"), Optional.of(SSL_CONFIGURATION));
<snip>
// TODO(aash): is going through a ServiceConfigurationFactory the best way to convert
// PartialServiceConfiguration -> ClientConfiguration ?
stats = JaxRsClient.create(FoundryStatsService.class, USER_AGENT, ClientConfigurations.of(
ServiceConfigurationFactory.of(
ServicesConfigBlock.builder().putServices("foundry-stats", STATS_CONFIG).build()).get(
"foundry-stats")));
Activity
qinfchen commentedon Aug 16, 2017
Can we make
ServiceConfigurationFactory.propagateDefaultspublic?uschi2000 commentedon Aug 16, 2017
What's the use-case for this?
qinfchen commentedon Aug 16, 2017
Having a PartialServiceConfiguration declare outside the service discovery block like multipass'
or slate's postgate data source config
It'd be great if we can specify service configuration outside of service discovery without requiring ssl block. Unless we are encouraging teams to only take service configuration from service discovery?
uschi2000 commentedon Aug 17, 2017
In order to use propagateDefaults, you'd need a handle on a ServiceConfigBlock; if you have one of those, why not use ServiceConfigurationFactory#get ?
qinfchen commentedon Aug 17, 2017
ServiceConfigBlock may not have the corresponding service config block for the PartialServiceConfiguration. I wonder if we should expose a convenient method of converting PartialServiceConfiguration to a ServiceConfiguration by filling in the defaults that are not present, which is what propagateDefaults does mostly
uschi2000 commentedon Aug 17, 2017
Such a method exists: build a custom ServiceConfigBlock and then call get().
meditativeape commentedon Aug 24, 2017
ServiceConfigurationFactory#getonly works for services defined in theServicesConfigBlock. In some places, we define partial service configurations outside of the service discovery block, for example workers, and event consumers. The defaults inServicesConfigBlockshould get propagated to those as well, but currently there's no good way of doing that.ash211 commentedon Oct 3, 2017
I had to do this also, workaround is to build a
ServicesConfigBlockwith a named service and then retrieve the same service back.@uschi2000 is this what you intend?
uschi2000 commentedon Oct 4, 2017
We can add a static method ServiceConfigurationFactory that turns a partial config into a full one, or throws if not all required fields are set.
qinfchen commentedon Oct 4, 2017
+1, created a pr for this https://github.com/palantir/http-remoting-api/pull/54