We have been using Eureka with our Spring Boot applications for few months now. We have enabled service lookup between applications using @DiscoveryClient
annotations. The registrations, lease renewals and deregistration works as expected.
Recently, we have encountered a scenario where we have non-Java application component (written in C++), which is exposes 3 REST service endpoints that many of our Spring Boot Java applications would use. We are trying to see if the C++ component can make use of the Eureka server's REST APIs to register itself when it came up, so that the Spring Boot Java applications can perform the usual lookup via Eureka to get in touch with the C++ component.
Since I cannot use the Eureka Client in the C++ components (obviously), I started testing direct REST APIs (as described here) using Postman. The registration worked without any problems by sending a JSON payload using POST method to http://eurekaserver:8761/eureka/apps/FOO-APP (with instanceId = 1111 and hostName = foo-app). I can query http://eurekaserver:8761/eureka/apps and can see FOO-APP listed there as expected.
However, when I try the cancel operation using DELETE method to http://eurekaserver:8761/eureka/apps/FOO-APP/1111 or http://eurekaserver:8761/eureka/apps/FOO-APP/foo-app, I get a 404 error.
With instanceId:
{
"timestamp": 1447479397996,
"status": 404,
"error": "Not Found",
"message": "Not Found",
"path": "/eureka/apps/FOO-APP/1111"
}
OR (same outcome for hostName):
{
"timestamp": 1447479397996,
"status": 404,
"error": "Not Found",
"message": "Not Found",
"path": "/eureka/apps/FOO-APP/foo-app"
}
I tried different combinations, but I am not able to make this work. I have a feeling I am missing something obvious - may be something small. Any help on this would be appreciated.
PS: Eureka REST endpoint documentation mentions "v2" in the URL. However, that does not work in my case. Registration (which works for me) does not use "v2" as described above. If someone could validate this, that would be helpful as well. There just doesn't seem to be enough material on this.