0
votes

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.
1
How does it fail?Darren Forsythe
I have added exception and code for PreFilter...Yogi
Do the files have a file suffix? If yes, maybe take a look at the answer here: stackoverflow.com/a/30794212pan
No, i didn't have file suffix issuesYogi

1 Answers

0
votes

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