Implement a custom HystrixPropertiesStrategy plugin

Add a custom HystrixPropertiesStrategy implementation where getCommandPropertiesCacheKey is overridden to return null so that HystrixPropertiesFactory will always generate a new HystrixCommandProperties for each new HystrixCommand instantiation.
Looks like the least invasive solution so far :+1:
On Oct 3, 2014 7:21 PM, "Lloyd" <notifications@github.com> wrote:

> In app/com/m3/octoparts/hystrix/CachelessHystrixPropertiesStrategy.scala:
>
> > @@ -0,0 +1,13 @@
> > +package com.m3.octoparts.hystrix
> > +
> > +import com.netflix.hystrix.{ HystrixCommandKey, HystrixCommandProperties }
> > +import com.netflix.hystrix.strategy.properties.HystrixPropertiesStrategy
> > +
> > +/**
> > + * Custom [[HystrixPropertiesStrategy]] implementation where  getCommandPropertiesCacheKey is overridden
> > + * to return null so that [[com.netflix.hystrix.strategy.properties.HystrixPropertiesFactory]] will always
> > + * generate a new [[HystrixCommandProperties]] for each new [[com.netflix.hystrix.HystrixCommand]] instantiation
> > + */
> > +class CachelessHystrixPropertiesStrategy extends HystrixPropertiesStrategy {
> > +  override def getCommandPropertiesCacheKey(commandKey: HystrixCommandKey, builder: HystrixCommandProperties.Setter): String = null
>
> Reflecting on this now, I guess can get the hashCode of builder, combine
> it with the commandKey.name in a string and return that.
>
> `HystrixPropertiesFactory will be responsible for caching the properties
> using the returned string anyways.
>
> The disadvantage is that theoretically, the cache could grow out of hand.
>
> @mauhiz <https://github.com/mauhiz> @cb372 <https://github.com/cb372>
> what do you think?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/m3dev/octoparts/pull/36/files#r18388802>.
>