These are chat archives for spring-cloud/spring-cloud

18th
Apr 2017
wooshie
@wooshie
Apr 18 2017 13:21
hi, is it possible to configure some route to bypass the filters (we are handling big file uploads there)?
and it was about zuul
sorry, i'm heavily in my own context :(
Dave Syer
@dsyer
Apr 18 2017 13:48
I still don't understand the question
But AFAIK Zuul runs all filters.
David Steiman
@xetys
Apr 18 2017 13:49
hey...about an year ago I used context.addZuulRequestHeader("Authorization", "...."); to add some headers to specific parts....I just updated to Dalston and this doesn't works....
did something changed on that?
Dave Syer
@dsyer
Apr 18 2017 13:50
Nope. Not as far as I know.
David Steiman
@xetys
Apr 18 2017 13:51
I checked that line is actually called on the api
but getting a 401...
Dave Syer
@dsyer
Apr 18 2017 13:52
Are you upgrading from a very old version of Spring Cloud?
David Steiman
@xetys
Apr 18 2017 13:53
yes
if you treat brixton.sr5 as very old
David Steiman
@xetys
Apr 18 2017 14:11
any thoughts?
Dave Syer
@dsyer
Apr 18 2017 14:13
Do you have a simple sample?
David Steiman
@xetys
Apr 18 2017 14:13
wait
wooshie
@wooshie
Apr 18 2017 14:32
@dsyer in https://github.com/spring-cloud/spring-cloud-netflix/blob/master/docs/src/main/asciidoc/spring-cloud-netflix.adoc#uploading-files-through-zuul it is written: For large files there is an alternative path which bypasses the Spring DispatcherServlet (to avoid multipart processing) in "/zuul/". I.e. if zuul.routes.customers=/customers/** then you can POST large files to "/zuul/customers/".
@dsyer so i was wondering if it is possible to configure such bypass rightaway, so that for certain service i'd go this "/zuul/customers" way instead of plain "/customers/" and multipart processing?
David Steiman
@xetys
Apr 18 2017 14:34
even better, in a fresh new project from start.spring.io defining a new ZuulFilter end up in a NullPointerException
Spencer Gibb
@spencergibb
Apr 18 2017 14:35
@wooshie your clients would have to know which to go to
@xetys stacktrace?
David Steiman
@xetys
Apr 18 2017 14:36
java.lang.NullPointerException: null
    at com.netflix.zuul.FilterLoader.getFiltersByType(FilterLoader.java:186) ~[zuul-core-1.3.0.jar:1.3.0]
    at com.netflix.zuul.FilterProcessor.runFilters(FilterProcessor.java:153) ~[zuul-core-1.3.0.jar:1.3.0]
    at com.netflix.zuul.FilterProcessor.error(FilterProcessor.java:105) ~[zuul-core-1.3.0.jar:1.3.0]
    at com.netflix.zuul.ZuulRunner.error(ZuulRunner.java:112) [zuul-core-1.3.0.jar:1.3.0]
    at com.netflix.zuul.http.ZuulServlet.error(ZuulServlet.java:145) [zuul-core-1.3.0.jar:1.3.0]
    at com.netflix.zuul.http.ZuulServlet.service(ZuulServlet.java:76) [zuul-core-1.3.0.jar:1.3.0]
    at org.springframework.web.servlet.mvc.ServletWrappingController.handleRequestInternal(ServletWrappingController.java:157) [spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]
...
wooshie
@wooshie
Apr 18 2017 14:37
@spencergibb yeah, but still, would be more flexible and comfortable to have such option, so that externally it would be seamless for ease of integration sake
David Steiman
@xetys
Apr 18 2017 14:38
I just created a new boot app with 1.5.2 and Dalston.RELEASE, using security and Zuul starter, added a user, defined a controller, defined a second redirect root on that controller, and added a filter...
Spencer Gibb
@spencergibb
Apr 18 2017 14:38
@wooshie unfortunately it's one or the other, run through the spring dispatcher servlet /customers or not /zuul/customers. It can't be done on a case by case basis
Dave Syer
@dsyer
Apr 18 2017 14:39
@xetys looks like your filter has a null "filterType"
wooshie
@wooshie
Apr 18 2017 14:39
@spencergibb not now for sure, might be an option in future though?
Spencer Gibb
@spencergibb
Apr 18 2017 14:39
not really
Dave Syer
@dsyer
Apr 18 2017 14:40
@wooshie unlikely - it's 2 different servlets
David Steiman
@xetys
Apr 18 2017 14:40
it has...
oops
wooshie
@wooshie
Apr 18 2017 14:41
@dsyer passing request from one servlet to another based on configuration option?
@dsyer or that would complicate things?
Dave Syer
@dsyer
Apr 18 2017 14:42
Feel free to mess around with it and send a pull request if you get something working
wooshie
@wooshie
Apr 18 2017 14:42
ok :)
David Steiman
@xetys
Apr 18 2017 14:43
ok...on that fresh project the filter seems to work
David Steiman
@xetys
Apr 18 2017 14:49
I solved it by giving my filter a higher order number...