Just test Finchley.RC1, and eureka server version is 1.4.4.RELEASE. use lower case service id will got 404, only upper case can find service.
find in DiscoveryClientRouteDefinitionLocator:
String serviceId = instance.getServiceId();
there get the upper case serviceId, and predicate will be 'Path=/SERVICE_ID/**'.
one solution is add a DataBindingMethodResolver to SimpleEvaluationContext, then we can set urlExpression like 'lb://'+serviceId.toLowerCase().
Can you provide your route configuration? Does it make a difference if you use Spring Cloud Eureka Server 2.0.0.RC1?
I'm facing the same issue after upgrading to Finchley.RC1.
Requests to http://localhost:4080/service/** yield 404 error, where http://localhost:4080/SERVICE/** works fine.
Here is route definition from application.yaml:
spring:
cloud:
gateway:
discovery.locator.enabled: true
Checked against Spring Cloud Eureka Server 2.0.0.RC1.
@ryanjbaxter config same as @maciejlach
After 3d2364a you can now do this:
spring.cloud.gateway.discovery.locator:
filters:
- name: RewritePath
args:
regexp: "'/' + serviceId.toLowerCase() + '/(?<remaining>.*)'"
replacement: "'/$\\{remaining}'"
predicates:
- name: Path
args:
pattern: "'/'+serviceId.toLowerCase()+'/**'"
Though that is a lot of boiler plate for an option that will be used fairly often, so more to come.
Setting spring.cloud.gateway.discovery.locator.lowerCaseServiceId=true in gateway service will make your service id lowercase by default
Most helpful comment
Setting
spring.cloud.gateway.discovery.locator.lowerCaseServiceId=truein gateway service will make your service id lowercase by default