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.

Zuul2: Routing without using Eureka service discovery

See original GitHub issue

Hello,

We want to use Zuul without service discovery, for instance, defining properties such as zuul.routes.books.url = http://localhost:8090/books, and routing accordingly with a custom filter. But, I can’t figure out how to disable eureka and perform routing via custom filters. zuul-core has dependencies to ribbon-eureka and eureka-client, and disabling eureka seems impossible to me.

Is it possible? OR Are you considering to release a zuul-without-eureka?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

12reactions
mmdemirbascommented, Jan 15, 2018

Thank you, it works.

My configuration (application.properties) is below, in the case someone else needs it:

### Instance env settings

region=us-east-1
environment=test

## Eureka instance registration for this app

Name of the application to be identified by other services
eureka.name=zuul

The port where the service will be running and serving requests
eureka.port=7001

Virtual host name by which the clients identifies this service
eureka.vipAddress=${eureka.name}:${eureka.port}

For eureka clients running in eureka server, it needs to connect to servers in other zones
eureka.preferSameZone=false

 Don't register locally running instances.
eureka.registration.enabled=false

# Loading Filters
zuul.filters.root=zuul-sample/src/main/groovy/com/netflix/zuul/sample/filters
zuul.filters.locations=${zuul.filters.root}/inbound,${zuul.filters.root}/outbound,${zuul.filters.root}/endpoint
zuul.filters.packages=com.netflix.zuul.filters.common

##########################################
## Everything above included in the sample.
## Everything below added by me.
##########################################

api.ribbon.listOfServers=localhost:8090
api.ribbon.client.NIWSServerListClassName=com.netflix.loadbalancer.ConfigurationBasedServerList

eureka.validateInstanceId=false
eureka.shouldFetchRegistry=false

zuul.server.port.main=9090

And inside Routes.apply() method (Routes is an HttpInboundSyncFilter included in the sample):

SessionContext context = request.getContext()
context.setEndpoint(ZuulEndPointRunner.PROXY_ENDPOINT_FILTER_NAME);
context.setRouteVIP("api")
0reactions
SMakhrovcommented, Nov 29, 2020

@BigSully, @artgon hi! Could you help please - why is it doesn’t work if url with multiple subdomains? Like this: test.s3-us-west-2.amazonaws.com:80

I see 301 Permanent redirect.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can Zuul Edge Server be used without Eureka / Ribbon
Yes, it is totally possible.You have to use @EnableZuulProxy on your config class and config it something like this : zuul: routes: ...
Read more >
There Is No Zuul, Only Eureka: Zero-Touch Zuul Routing
With this change alone, the route defined in the service will be accessible by Zuul, but we still need to configure Zuul to...
Read more >
An Example of Load Balancing with Zuul and Eureka - Baeldung
In this article, we'll look at how load balancing works with Zuul and Eureka. We'll route requests to a REST Service discovered by...
Read more >
8. Router and Filter: Zuul - Spring Cloud
the Zuul starter does not include a discovery client, so, for routes based on service IDs, you need to provide one of those...
Read more >
Service Discovery With Eureka and Zuul - DZone Microservices
We will demonstrate a small Zuul application. It will register with a Eureka server and automatically set up dynamic routing based on other ......
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