• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

SpringGateway routing to versioned API

 
Ranch Hand
Posts: 157
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

As part of our spring micro services API, I want to route the request to correct end point..

 /api1/v1/product
/api/v2/product
/api/v3/product

But the UI is invoking like

/api/product  -  to be mapped to v1 ( which is default)
/api/product?version=v2 (should be routed to /api/v3/product)
/api/product?version=v3 ( should be routed to /api/v3/product )

How to achieve this in Spring Cloud Gateway.. should I write the custom router or any predicate mapping example..

Thanks in advance

 
Bartender
Posts: 2419
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is a learning curve about configuring Spring Cloud Gateway.
Here is one of the tutorials:
https://www.baeldung.com/spring-cloud-gateway

You may need to find some courses about microservices.
 
Get out of my mind! Look! A tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic