question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Zuul routes cannot be changed dynamically from "url" to "serviceId"

See original GitHub issue

I noticed that it is possible to edit routes via Spring cloud Config (or by changing the yml directly) with the same type url, but it is not possible to change the route to point to a service VIP

Scenario:

  • routed defined:
zuul:
ignored-services: "*"
  routes:
    echo3:
      path: /echo3/**
      url: http://www.aaa.com
  • route shows fine in /admin/routes
  • change route to
zuul:
ignored-services: "*"
  routes:
    echo3:
      path: /echo3/**
      serviceId: echo-service
  • hit /admin/refresh() endpoint. The response mentions that changes were detected about the route
  • Problem: /admin/routes still shows the old route, pointing to url

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
ghostcommented, Nov 2, 2016

APPLICATION FAILED TO START


Description:

Field zuulProperties in org.springframework.cloud.netflix.zuul.ZuulConfiguration required a single bean, but 2 were found: - zuul.CONFIGURATION_PROPERTIES: defined in BeanDefinition defined in class path resource [gateway/ApiGatewayConfiguration.class] - zuul-org.springframework.cloud.netflix.zuul.filters.ZuulProperties: defined in null

Action:

Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed

3reactions
aivanscommented, Dec 11, 2015

It worked when adding this code to a configuration class. The idea is to have the ZuulProperties bean with @RefreshScope

    @Bean(name="zuul.CONFIGURATION_PROPERTIES")
    @RefreshScope
    @ConfigurationProperties("zuul")
    public ZuulProperties zuulProperties() {
        return new ZuulProperties();
    }
Read more comments on GitHub >

github_iconTop Results From Across the Web

Dynamically change the url of a route in Zuul based on query ...
As the title suggests I want to change the url based on a given query parameter. So for example if I request: ......
Read more >
8. Router and Filter: Zuul - Spring Cloud
By default, the servlet has an address of /zuul . This path can be changed with the zuul. servlet-path property.
Read more >
Routing requests and dynamically refreshing routes using ...
Configuring Spring Cloud Netflix Zuul server to route requests to downstream services. Dynamically refreshing the Zuul routes using Eureka ...
Read more >
Fallback for Zuul Route - Baeldung
Zuul is an edge service (or API gateway) from Netflix that provides dynamic routing, monitoring, resiliency, and security.
Read more >
Chapter 6. Service routing with Spring Cloud and Zuul
Dynamic routing — B cireesv ytewaag zsn setpnci iigncomn eisrcve steqsrue znq, ... the routes for all the services in your application to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found