Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GlobalFilter documentation should be update WRT Order #3269

Open
dancerjohn opened this issue Feb 19, 2024 · 2 comments
Open

GlobalFilter documentation should be update WRT Order #3269

dancerjohn opened this issue Feb 19, 2024 · 2 comments

Comments

@dancerjohn
Copy link

Describe the bug
The documentation WRT GlobalFilter and ordering suggests that GlobalFilter and GatewayFilter order can be controls via the Ordered interface (or @ordered annotation). However, it appears that regardless of the GlobalFilter order, the GatewayFilters are applied first. This should be clarified in the documentation or (preferably) fixed so that a GlobalFilter with a higher precedence than a GatewayFilter will be applied first.

From: https://docs.spring.io/spring-cloud-gateway/reference/spring-cloud-gateway/global-filters.html
"When a request matches a route, the filtering web handler adds all instances of GlobalFilter and all route-specific instances of GatewayFilter to a filter chain. This combined filter chain is sorted by the org.springframework.core.Ordered interface, which you can set by implementing the getOrder() method."

This comment is what clued me in:
#2784 (comment)

@spencergibb
Copy link
Member

I wonder if #2934 and #2912 fixed this?

@dancerjohn
Copy link
Author

dancerjohn commented Mar 11, 2024

This is what I BELIEVE is the distinction. In each set (global vs non-global) order is respected. However relative the other opposite set, non-global are applied before global regardless of relative order. Also 2934 is in reference to the Order annotation vs Ordered interface. I believe I tried both. That said, I am using 3.1.9 so possible 2934 might address it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants