spring-cloud-config icon indicating copy to clipboard operation
spring-cloud-config copied to clipboard

Zuul routing order is not preserved while fetching the routes from config server

Open sureshkrishnamoorthy opened this issue 6 years ago • 7 comments

We have updated our zuul service to Hoxton release recently. As per the documentation, if we use yml file for routes the order will be preserved but After the update we noticed that the zuul routing order is lost when the routes are fetched from config server but if we have the routes as part of application it is working as expected.

For eg below is our sample routing config

zuul:
  routes:
    specificproduct:
      path: /v1/product/electronics/**
      service-id: electronic-product-service
      strip-prefix: false
      sensitiveHeaders:
    genericproduct:
      path: /v1/product/**
      service-id: product-service
      strip-prefix: false
      sensitiveHeaders:

In our case, if the routes are fetched from config server the requests are always forwarded to product-service instead of electronic-product-service even the path is /v1/product/electronics/** This works as expected when we have the route config as part of application and disable config server.

sureshkrishnamoorthy avatar Dec 24 '19 14:12 sureshkrishnamoorthy

Can you provide a complete, minimal, verifiable sample that reproduces the problem? It should be available as a GitHub (or similar) project or attached to this issue as a zip file.

spencergibb avatar Dec 24 '19 14:12 spencergibb

@spencergibb Attached the projects to replicate the issue, In this zuul routing order is not consistent for the same routes defined in embedded config (in zuul app) and config server yml configuration.

spring:
  cloud:
    config:
      enabled: false

Toggling the above property in zuul, provides different routing order. Please check and let us know how retain the routing order when the routes are served from config server.

zuul-routing-order-issue.zip

sureshkrishnamoorthy avatar Dec 26 '19 04:12 sureshkrishnamoorthy

@spencergibb Hope you were able to reproduce the issue using the sample project that was uploaded. Please suggest the solution or any work around to overcome this issue.

sureshkrishnamoorthy avatar Jan 07 '20 13:01 sureshkrishnamoorthy

I have not, yesterday was my first day back after holiday

spencergibb avatar Jan 07 '20 13:01 spencergibb

I've verified this is an issue, though I'm not sure if the issue is here, config client or spring cloud commons.

spencergibb avatar Jan 07 '20 17:01 spencergibb

I've verified this is an issue, though I'm not sure if the issue is here, config client or spring cloud commons.

i am experience the same, after i put routes in config server. routing such example above wasn't working properly.

masulum avatar Feb 28 '20 13:02 masulum

Hoxton.SR3 hasn't been released yet, hopefully tomorrow.

spencergibb avatar Mar 03 '20 19:03 spencergibb