create route that points to a microservice method with zuul

453 views Asked by At

Is it possible to create a route that points to a method inside a microservice?, I have a microservice called MsCargosAbonos that is discovered by my eureka server, inside my microservice I have a method called pago, my zuul application url is http://localhost:8000, I can call the microservice like this:

http://localhost:8000/mscargosabonos/pago

So I want to change the url above to:

http://localhost:8000/ejecutarPago

Is it possible to do this with zuul?

Thanks in advance.

1

There are 1 answers

1
Alan Gaytan On BEST ANSWER

I modify my application.yml like this:

zuul:
  prefix: /api
  routes:
    pago:  
      path: /pago/**
      url: http://localhost:8000/api/mspago/

I don't know if this is the correct way to do this so if someone has a better idea please share it with me, thanks.