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

28th
Jun 2015
Thomas Jaeckle
@thjaeckle
Jun 28 2015 09:33
Hi spring clouders. Does anyone has experience or an example in writing a custom "pre" ZuulFilter (when using spring cloud Netflix) which rejects a request right away without delegating to proxied services? Somehow I didn't get this working ..
Dave Syer
@dsyer
Jun 28 2015 10:06
By "reject" do you mean "render a response with a 4xx status code" or something?
Thomas Jaeckle
@thjaeckle
Jun 28 2015 10:37
Exactly, but without passing the request further (to other filters and the services) along
Dave Syer
@dsyer
Jun 28 2015 10:40
I'm not sure you can do that
I think all the filters get executed unless they explicitly ask not to be
Maybe you should use a regular servlet Filter?
Thomas Jaeckle
@thjaeckle
Jun 28 2015 10:51
Oh, I see. The regular Filter could/would then be executed also for all requests passing the api gateway? Could that filter be executed asynchronously? that's another problem I had anyway with the ZuulFilter ;-)
Dave Syer
@dsyer
Jun 28 2015 11:01
Asynchronous to what?
Thomas Jaeckle
@thjaeckle
Jun 28 2015 11:05
Not blocking a thread while the filter does its work. Sorry, it's been a while for me to work with Servlets and Filters. Maybe this is not a problem any more.
Not blocking the calling thread, of course. Want to do a remote call in the filter..
Dave Syer
@dsyer
Jun 28 2015 11:45
Servlet 3.1 has asynchronous requests, probably that's what you need.
Thomas Jaeckle
@thjaeckle
Jun 28 2015 11:47
Ok, thanks. will have a look into that.