Skip to content

Commit

Permalink
Be less controlling about HystrixPropertiesStrategy
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydmeta committed Oct 7, 2014
1 parent fbac667 commit e0686f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
8 changes: 2 additions & 6 deletions app/com/m3/octoparts/Global.scala
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,13 @@ object Global extends WithFilters(MetricsFilter) with ScaldiSupport {
def setHystrixPropertiesStrategy(app: Application): Unit = {
// If it's defined, we don't need to set anything
if (sys.props.get("hystrix.plugin.HystrixPropertiesStrategy.implementation").isEmpty) {
LTSVLogger.warn("-Dhystrix.plugin.HystrixPropertiesStrategy.implementation is not set. It should be" -> "com.m3.octoparts.hystrix.KeyAndBuilderValuesHystrixPropertiesStrategy")
LTSVLogger.info("-Dhystrix.plugin.HystrixPropertiesStrategy.implementation is not set. Defaulting to" -> "com.m3.octoparts.hystrix.KeyAndBuilderValuesHystrixPropertiesStrategy")
try {
HystrixPlugins.getInstance().registerPropertiesStrategy(new KeyAndBuilderValuesHystrixPropertiesStrategy)
} catch {
case NonFatal(e) => {
val currentStrategy = HystrixPlugins.getInstance().getPropertiesStrategy.getClass
if (currentStrategy != classOf[KeyAndBuilderValuesHystrixPropertiesStrategy]) {
LTSVLogger.error(e, "Current Hystrix Properties Strategy:" -> currentStrategy)
if (Play.mode(app) != Mode.Test)
sys.error("Tried but failed to set KeyAndBuilderValuesHystrixPropertiesStrategy as HystrixPropertiesStrategy")
}
LTSVLogger.info(e, "Current Hystrix Properties Strategy:" -> currentStrategy)
}
}
}
Expand Down
1 change: 0 additions & 1 deletion project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ object OctopartsBuild extends Build {
sonatypeSettings ++
coverallsSettings ++
Seq(
javaOptions += "-Dhystrix.plugin.HystrixPropertiesStrategy.implementation=com.m3.octoparts.hystrix.KeyAndBuilderValuesHystrixPropertiesStrategy",
publishArtifact := false,
libraryDependencies ++= Seq(
// Logging
Expand Down

0 comments on commit e0686f1

Please sign in to comment.