1

I am trying to use the spring cloud API gateway with micronaut microservice, for routes routing as we can see in the below diagram, both the application are register to Consul discovery service.

enter image description here

I use Micronaut for rest API because it is fast and less memory consumption, however, I use spring API gateway because Micronaut has no built-in API gateway service.

Now Micronaut microservice expose the open API in YAML schema, however, spring open API expose in JSON schema

As per spring gateway

gateway:
      routes:
        - id: product-service
          uri: lb://PRODUCT-SERVICE
          predicates:
            - Path= /product/**
          filters:
            - name: CircuitBreaker
              args:
                name: Product-service
                fallbackuri: forward:/productFallBack
            - RewritePath=/product/(?<path>.*), /$\{path}
        - id: openapi
          uri: http://localhost:${server.port}
          predicates:
            - Path=/v3/api-docs/**
          filters:
            - RewritePath=/v3/api-docs/(?<path>.*), /$\{path}/v3/api-docs

How can I make this work or I am doing something wrong

San Jaisy
  • 15,327
  • 34
  • 171
  • 290
  • The micro service "Micronaut one" is setting behind a spring api gateway and is discoverable by some discovery service... you said "Micronaut microservice expose the open API in YAML schema" what service is consuming that API? Just trying to get more context – z atef Oct 17 '20 at 05:14
  • @zee The API gateway should consume that microservice, it should reroute to the microservice URL – San Jaisy Oct 17 '20 at 05:32

0 Answers0