title: Feign client sub-domain : ambiguous mapping
body: <p>I'm using Spring Boot <code>2.0.3.RELEASE</code> and openFeign:</p>
  
  <pre class="lang-xml prettyprint-override"><code>        &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
              &lt;artifactId&gt;spring-cloud-starter-openfeign&lt;/artifactId&gt;
          &lt;/dependency&gt;
  </code></pre>
  
  <p>I declared two feign clients in my project:</p>
  
  <pre class="lang-java prettyprint-override"><code>@FeignClient(name = "appleReceiptSandboxFeignClient",
      url = "https://sandbox.itunes.apple.com",
      configuration = Conf.class)
  @RequestMapping(produces = "application/json", consumes = "application/json")
  public interface AppleReceiptSandboxFeignClient {
  
      @RequestMapping(value = "/verifyReceipt", method = RequestMethod.POST)
      AppleReceiptResponseDTO sandboxVerifyReceipt(@RequestBody AppleReceiptRequestDTO dto);
  
  }
  </code></pre>
  
  <pre class="lang-java prettyprint-override"><code>@FeignClient(name = "appleReceiptFeignClient",
      url = "https://buy.itunes.apple.com")
  @RequestMapping(produces = "application/json", consumes = "application/json")
  public interface AppleReceiptFeignClient {
  
      @RequestMapping(value = "/verifyReceipt", method = RequestMethod.POST)
      AppleReceiptResponseDTO productionVerifyReceipt(@RequestBody AppleReceiptRequestDTO dto);
  
  }
  </code></pre>
  
  <p>My problem is that even if the base urls and the name are not the same, it seems that the feign clients are considered in collision.</p>
  
  <pre><code>java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'com.myproject.central.client.AppleReceiptSandboxFeignClient' method 
  public abstract com.myproject.central.client.dto.AppleReceiptResponseDTO com.myproject.central.client.AppleReceiptSandboxFeignClient.sandboxVerifyReceipt(com.myproject.central.client.dto.AppleReceiptRequestDTO)
  to {[/verifyReceipt],methods=[POST],consumes=[application/json],produces=[application/json]}: There is already 'com.myproject.central.client.AppleReceiptFeignClient' bean method
  public abstract com.myproject.central.client.dto.AppleReceiptResponseDTO com.myproject.central.client.AppleReceiptFeignClient.productionVerifyReceipt(com.myproject.central.client.dto.AppleReceiptRequestDTO) mapped.
  </code></pre>
  
  <p>Even if this mapping error is unexpected, I'm opened to workarounds.</p>
  
  <p>I obviously cannot declare the two endpoints in the same feign client because the subdomain differs, or maybe am I missing something ?</p>
  
  <p>My question is: what would be the simplest workaround (if any) using only feign client ?</p>