0

I am working on FileStore application, FileStore is a Spring boot application.

we want didn't to publish the URL of FileStore application, We wanted to put Zuul application,which will work like proxy.

I tried basic Zuul gateway example. It all works good for normal request following below example

  1. https://spring.io/guides/gs/routing-and-filtering/

But it fails for mulitpart request. Can anyone have example for support multipart request using Zuul proxy.

We are trying to upload large files via Zuul proxy...

Exception stacktrace

PreFilter Code:

  public class MyPreFilter extends ZuulFilter{

     @Override
      public String filterType() {
        return "pre";
      }

      @Override
      public int filterOrder() {
        return 1;
      }

      @Override
      public boolean shouldFilter() {
        return true;
      }

      @Override
      public Object run() {
        RequestContext ctx = RequestContext.getCurrentContext();
        HttpServletRequest request = ctx.getRequest();

        log.info(String.format("%s request to %s", request.getMethod(), request.getRequestURL().toString()));

        return null;
      }

}


Thanks in advance.
Yogi
  • 1,805
  • 13
  • 24

1 Answers1

0

You can use following configuration on zuul API gateway:

zuul:
routes:
  user-service-1:
       path: /api/userserv1/**
       url: http://localhost:9090
       strip-prefix: false
  user-service-2:
       path: /api/userserv2/**
       url: http://localhost:9091
       strip-prefix: false 
  user-service-3:
       path: /api/userserv3/**
       url: http://localhost:9092
       strip-prefix: false