2017-01-14 1 views
0

je veux déplacer la configuration ci-dessous dans l'annotation de méthode pour fichier de propriétésapplication.yml pas repris par hystrix

@HystrixCommand(commandProperties = { 
      @HystrixProperty(name = "circuitBreaker.sleepWindowInMilliseconds", value = "10000"), 
      @HystrixProperty(name = "metrics.rollingStats.timeInMilliseconds", value = "10000"), 
      @HystrixProperty(name = "circuitBreaker.requestVolumeThreshold", value = "5"), 
      @HystrixProperty(name = "circuitBreaker.errorThresholdPercentage", value = "100") 
    }, 
      fallbackMethod = "fallbackCall") 

Je place le fichier application.yml sous src/main/resources

hystrix: 
    command.: 
    getResult: 
     circuitBreaker: 
     sleepWindowInMilliseconds: 10000 
     errorThresholdPercentage: 100 
     requestVolumeThreshold: 5 
     metrics: 
     rollingStats: 
      timeInMilliseconds: 10000 

Je n'utilise pas de botte à ressort. Ce fichier n'est pas récupéré par Hystrix.

Y a-t-il une configuration à faire pour passer la configuration application.yml à hystrix?

Répondre

0

créé comme config.properties et cela a fonctionné. Ceci est par défaut recherché par archaius

hystrix.command.getResult.metrics.rollingStats.timeInMilliseconds=10000 
hystrix.command.getResult.circuitBreaker.requestVolumeThreshold=5 
hystrix.command.getResult.circuitBreaker.errorThresholdPercentage=100 
hystrix.command.getResult.circuitBreaker.sleepWindowInMilliseconds=10000 
+0

Il ya un pont et cela fonctionne. Il doit y avoir un problème avec vos dépendances, comment apportez-vous hystrix? – spencergibb