Closed xiaoshao closed 5 years ago
Seems like that was answered here https://github.com/spring-cloud/spring-cloud-gateway/issues/185#issuecomment-520678570
I am not sure what else to say
@ryanjbaxter I realized that the spring-cloud-gateway add the route definition explicitly, and not generate route definition automatically as zuul after I read the issue 185 again.
thanks @ryanjbaxter
It certainly can generate route definitions automatically
@ryanjbaxter @spencergibb I totally missed your means. And @spencergibb missed my mind.
In the issue 185 , @spencergibb told me that, it don't need ignore service not do not need ignore pattern.
about reply from @ryanjbaxter
The gateway isnt proactive like Zuul is and automatically creates routes based on service discovery they have to be explicitly configured (as far as I know). Can you provide an example of where this would be necessary?
I missed the is and
in The gateway isnt proactive like Zuul is and automatically creates routes based on service discovery they have to be explicitly configured (as far as I know) .
I think it should be and is
.
Now I am still confused that why ignore pattern is not necessary for spring cloud gateway ?
I add spring actuator in the service, but these rest interface should not be available from gateway.
You can exclude services from being added as described here https://github.com/spring-cloud/spring-cloud-gateway/issues/185#issuecomment-383782342
@ryanjbaxter I know how to exclude services. My question is how to exclude some rest interface.
Take an example, In the service A, there is some rest interface for bussiness and some rest interface for management. I just want to expose the bussiness interface but not expose management interface with gateway.
How to implement that in spring cloud gateway?
I am not following. You control the predicate that will match the requests...so you just define the predicate in such a way so that the managmenent interface will not match any predicate.
@tony-clarke-amdocs I know your mind. But the bussiness rest interface is complex (because of a bad design). It is hard to clear all the bussiness rest interface. And the management interface is clear.
I found that how to ignore the service in issue 185. But I still want to know spring cloud gateway support IgnorePatterns or not? currently, I created a prefilter with implements WebFilter for every request. But I dont think it a good idea.
Do you have more suggestion about it?