diff --git a/usergw-service/src/main/java/cn/ecpark/service/usergw/config/ConfigGateway.java b/usergw-service/src/main/java/cn/ecpark/service/usergw/config/ConfigGateway.java index e62b6a1..d17afcf 100644 --- a/usergw-service/src/main/java/cn/ecpark/service/usergw/config/ConfigGateway.java +++ b/usergw-service/src/main/java/cn/ecpark/service/usergw/config/ConfigGateway.java @@ -248,6 +248,8 @@ public class ConfigGateway implements RouteDefinitionLocator { Object order = iter.get("order"); if (order != null) { rd.setOrder((int) order); + } else { + rd.setOrder(0); } } @@ -272,7 +274,7 @@ public class ConfigGateway implements RouteDefinitionLocator { try { rd.setUri(URI.create((String) uri)); } catch (Exception e) { - log.warn("dubbo Uri error"); + log.warn("dubbo Uri = {} error, so set uri to default value dubbo://yame", uri); rd.setUri(URI.create("dubbo://yame")); } } else { diff --git a/usergw-service/src/main/resources/test-gateway3.yaml b/usergw-service/src/main/resources/test-gateway3.yaml index abc489f..b086bd7 100644 --- a/usergw-service/src/main/resources/test-gateway3.yaml +++ b/usergw-service/src/main/resources/test-gateway3.yaml @@ -15,7 +15,7 @@ restful: # filters 必须 有predicates uri只是预期到达的地址 - RewritePath=/http/rewrite, /http/hello - id: xixi - uri: http://localhost:8888/http/xixi + uri: http://localhost:8888 order: 11 predicates: - Path=/http/xixi