Home > other >  Spring cloud with multiple gateway routing uri?
Spring cloud with multiple gateway routing uri?

Time:09-28



Business code would only write four years of development, the distributed high concurrency also can't be a programmer? -> & gt; & gt;


Routes:
1
- id:Uri: http://10.10.11.42:8000/module/abc, http://10.10.11.42:8001/module/abc1
Predicates:
- Before=2020-01-01 T00:00:00 + 08:00 Asia/Shanghai
- Path=/module/ABC
Similar to such a route, URI have multiple instances, this space how to configure multiple IP it? Tried this configuration, only the first IP routing routing, the source code found in will only take the first, how to play?
Public RouteDefinition (String text) {
Int eqIdx=text. IndexOf (61);
If (eqIdx & lt;=0) {
Throw new thrown (" Unable to parse RouteDefinition text '" + text + "', must be of the form name=value ");
} else {
Enclosing setId (text. The substring (0, eqIdx));
String [] args=StringUtils. TokenizeToStringArray (text. The substring (eqIdx + 1), ", ");
Enclosing setUri (URI. The create (args [0]));
for(int i=1; I & lt; The args. Length; + + I) {
This. Predicates. Add (new PredicateDefinition (args [I]));
}

}
}

CodePudding user response:

There is a solution?

CodePudding user response:

Routing:
1
- id:Uri: lb://ABC
Predicates:

Custom configuration:
ABC:
Ribbon:
ListOfServers: http://10.10.11.42:8000/module/abc and http://10.10.11.42:8001/module/abc1
  • Related