I have an existing Spring Cloud Feign client interface that has many mappings for my server-side API. I'm adding some new methods, and I'm suddenly running into an error. I'm trying to add a method of the form:
@RequestMapping(value = "/tasks/{id}", method = GET)
public Resource<Task> getTask(@PathVariable("id")Long id);
Everything compiles fine, but when I try to make a call to the getTask() method above, I always get a an IllegalArgumentException complaining about the URL not being valid. Which is true, because the URL still contains the UriTemplate {id}.
The full stack is:
java.lang.IllegalArgumentException: Illegal character in path at index 29: http://connect/connect/tasks/{id}
at java.net.URI$Parser.fail(URI.java:2848)
at java.net.URI$Parser.checkChars(URI.java:3021)
at java.net.URI$Parser.parseHierarchical(URI.java:3105)
at java.net.URI$Parser.parse(URI.java:3053)
at java.net.URI.<init>(URI.java:588)
at java.net.URI.create(URI.java:850)
at feign.ribbon.RibbonClient.execute(RibbonClient.java:64)
at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:92)
at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:71)
at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:94)
at com.sun.proxy.$Proxy55.getTask(Unknown Source)
There are dozens of other methods in the same interface that use this exact same pattern, and everything runs fine. I cannot for the life of me figure out why Feign/Spring is suddenly having an issue with this method. I've tried every possible combination of settings and ways to write the method. If I simply remove the {id}, the call will go through, but obviously returns the wrong data, since its missing the id portion of the URI.
I'm using Spring Cloud Angel.SR6 with Spring Boot 1.2.8 and Feign 8.5.0.