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

Required Gobalfilter type interface in Spring Cloud Gateway MVC, and instead of bean creation properties level routes configuration #3382

Open
BornToCode1123 opened this issue May 2, 2024 · 2 comments

Comments

@BornToCode1123
Copy link

BornToCode1123 commented May 2, 2024

public class AuthFilter implements GlobalFilter, Ordered

alternate for this for spring cloud gateway mvc

spring.cloud.gateway.routes[0].id=first
spring.cloud.gateway.routes[0].uri=lb://first-service
spring.cloud.gateway.routes[0].predicates=Path=/first/**
spring.cloud.gateway.discovery.locator.enabled=true
spring.cloud.gateway.discovery.locator.lowerCaseServiceId=true

alternate properties for spring cloud gateway mvc

Thank you for the project and in advance for any help.

@spencergibb
Copy link
Member

Two things. server-webmvc already supports lb:// uris. Discovery locater enabled is not needed for that (that feature creates routes from discovery). See #3332 for discovery locator for server-webmvc. GlobalFilter is not needed either, use a servlet filter.

@BornToCode1123
Copy link
Author

BornToCode1123 commented May 6, 2024

@spencergibb i used below properties it's not working
spring.cloud.gateway.mvc.routes.id=configRoute1
spring.cloud.gateway.mvc.routes.configRoute1.uri=http://localhost:9803
spring.cloud.gateway.mvc.routes.configRoute1.predicates.Path=/hello

and used this but it's not working. can you please help me solve this with properties

I tried with the handler function it's not working. I need the same behavior as the global filter

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