I am having a small issue in getting the Zuul route config correct. Here's what I have currently
zuul:
routes:
microservice:
path: /service/*
serviceId: session
sensitiveHeaders: Cookie,Set-Cookie,Authorization
microservice:
ribbon:
listOfServers: localhost:8090
At the Microservice i have a Restcontroller like this:
@RestController
@RequestMapping("/service")
I have multiple end points in the RestController, for example:
@RequestMapping(method = { RequestMethod.GET}, value = "/service1", produces = "application/json")
Now when I send a request like localhost:8080/service/service1
it does not hit the expected endpoint. It routes the request to localhost:8090/service1
(where nothing is running).
It works well if I change the context path like this
@RestController
@RequestMapping("/service")
to
@RestController
@RequestMapping("/")
I have tried changing the path from
path: /service/*
to
path: /service/**
but no effect.
The other option is to force the routing at the filter level, but I think it should be possible to route localhost:8080/service/service1
to the microservice directly. Any suggestions on how I can get this done in the Zuul configuration.
I cannot use the URL option since it is not compatible with the fallback that I am working with.