0
votes

I'm quite new in things with the netflix cloud Microservice architecture.

There are three Microservices running in my Network:

  • Zuul/Ribbon Service: localhost:8765

    Application.yml: =============== eureka: client: serviceUrl: defaultZone: http://localhost:8761/eureka/

  • Eureka Service: localhost:8761

  • RentCarService: localhost:8888

Now, my request is: localhost:8765/RentCarService/getAllAvailableCars

This request should automatically routed forward to the right Microservice (RentCarService with Port 8888) like localhost:8888/getAllAvailableCars

I have seen much tutorials and the most of them are forwarding the requests programmatically like in this tutorial:

Microservice discovery with spring boot and eureka

Or here by a method called getServiceURL

Do i have to code the forwarding by my own or is this possible automatically by Ribbon?

Beste regards lars

2

2 Answers

0
votes

So far i got it working. My main problem was the different versions in the different microservies. Please be care about this!

Another think: I think an automatic routing (without any routing definition) is not possible. I had to write at least the name of microservice in the route definitions. The address resolution is be done by the Eureka server in that case.

Please correct me, if I'm wrong.

0
votes

There is no such thing as automatic routing till now for atleast we need to declare Zuul in your yml file which will handle routing.

In your application.yml add these line

 zuul:
  routes:
   users:
    path: /myusers/**
    serviceId: users_service

For ignoring any routing use ignoredServices property like

 zuul:
  ignoredServices: '*'

For more information please see this this link.

This will ignore all automatic routing of your services.

Hope this helps you out.

Thanks.