title: Setting request timeout with Netflix Feign and Hystrix
body: <p>I'm creating a REST client using Feign.  I've got my calls working, but I want to add some timeout support, and I'm having a heck of a time figuring out how to do that.</p>
  
  <p>Feign's documentation says "to use Hystrix with Feign, add the Hystrix module to your classpath. Then use the HystrixFeign builder."  Ok, so now I've got this:</p>
  
  <pre><code>service = HystrixFeign.builder()
                      .decoder(new GsonDecoder())
                      .target(ProjectService.class, URL_TO_BE_MOVED_TO_PROPS);
  </code></pre>
  
  <p>Now all of my methods are returning HystrixCommands, which I can execute or queue, but I still can't see how to configure them.</p>
  
  <p>The Hystrix wiki (<a href="https://github.com/Netflix/Hystrix/wiki/Configuration" rel="noreferrer">https://github.com/Netflix/Hystrix/wiki/Configuration</a>) says that configuration should be added into the HystrixCommand constructor like this:</p>
  
  <pre><code>public HystrixCommandInstance(int id) {
  super(Setter.withGroupKey(HystrixCommandGroupKey.Factory.asKey("ExampleGroup"))
          .andCommandPropertiesDefaults(HystrixCommandProperties.Setter()
                 .withExecutionTimeoutInMilliseconds(500)));
  this.id = id;
  </code></pre>
  
  <p>But my commands are being built/return by Feign, so I don't have access to the constructors.</p>
  
  <p>One more thing worth noting is that the Feign-Hystrix readme (<a href="https://github.com/Netflix/feign/tree/master/hystrix" rel="noreferrer">https://github.com/Netflix/feign/tree/master/hystrix</a>) says "To use Hystrix with Feign, add the Hystrix module to your classpath. Then, configure Feign to use the HystrixInvocationHandler," but a Google search for HystrixInvocationHandler points me toward a non-Netflix repo.  Even if I used that, I don't see how to configure Feign to use it.</p>
  
  <p>Please tell me I'm being dumb and that this is super simple, which will make me feel gladness that I'm past this issue, and shame for not being able to figure it out on my own.</p>
  
  <p>TL;DR:  I want to set timeouts on requests made by my Feign client.  How do?</p>