You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/04/05 07:16:37 UTC

[GitHub] [dubbo-go-samples] LaurenceLiZhixin opened a new pull request #81: [WIP] Ftr/dubbo3

LaurenceLiZhixin opened a new pull request #81:
URL: https://github.com/apache/dubbo-go-samples/pull/81


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-samples] AlexStocks commented on a change in pull request #81: Ftr/dubbo3

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on a change in pull request #81:
URL: https://github.com/apache/dubbo-go-samples/pull/81#discussion_r611164889



##########
File path: general/dubbo3/hessian2/README_zh.md
##########
@@ -0,0 +1,26 @@
+# Triple协议的Hessian2(Hessian+PB) 序列化方案

Review comment:
       同上,加上半角空格。




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-samples] AlexStocks commented on a change in pull request #81: Ftr/dubbo3

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on a change in pull request #81:
URL: https://github.com/apache/dubbo-go-samples/pull/81#discussion_r611165110



##########
File path: router/uniform-router/README_zh.md
##########
@@ -0,0 +1,31 @@
+# Dubbo-go v3 统一路由规则

Review comment:
       加上半角空格




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-samples] AlexStocks merged pull request #81: Ftr/dubbo3

Posted by GitBox <gi...@apache.org>.
AlexStocks merged pull request #81:
URL: https://github.com/apache/dubbo-go-samples/pull/81


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-samples] AlexStocks commented on a change in pull request #81: Ftr/dubbo3

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on a change in pull request #81:
URL: https://github.com/apache/dubbo-go-samples/pull/81#discussion_r611165372



##########
File path: router/uniform-router/k8s/go-server2/tests/integration/main_test.go
##########
@@ -0,0 +1,70 @@
+// +build integration
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package integration
+
+import (
+	hessian "github.com/apache/dubbo-go-hessian2"
+
+	_ "github.com/apache/dubbo-go/cluster/cluster_impl"
+	_ "github.com/apache/dubbo-go/cluster/loadbalance"
+	_ "github.com/apache/dubbo-go/common/proxy/proxy_factory"
+	"github.com/apache/dubbo-go/config"
+	_ "github.com/apache/dubbo-go/filter/filter_impl"
+	_ "github.com/apache/dubbo-go/protocol/dubbo"
+	_ "github.com/apache/dubbo-go/registry/protocol"
+	_ "github.com/apache/dubbo-go/registry/zookeeper"
+)
+
+import (

Review comment:
       挪到上面去




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-samples] AlexStocks commented on a change in pull request #81: Ftr/dubbo3

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on a change in pull request #81:
URL: https://github.com/apache/dubbo-go-samples/pull/81#discussion_r611165352



##########
File path: router/uniform-router/k8s/go-server/tests/integration/main_test.go
##########
@@ -0,0 +1,70 @@
+// +build integration
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package integration
+
+import (
+	hessian "github.com/apache/dubbo-go-hessian2"
+
+	_ "github.com/apache/dubbo-go/cluster/cluster_impl"
+	_ "github.com/apache/dubbo-go/cluster/loadbalance"
+	_ "github.com/apache/dubbo-go/common/proxy/proxy_factory"
+	"github.com/apache/dubbo-go/config"
+	_ "github.com/apache/dubbo-go/filter/filter_impl"
+	_ "github.com/apache/dubbo-go/protocol/dubbo"
+	_ "github.com/apache/dubbo-go/registry/protocol"
+	_ "github.com/apache/dubbo-go/registry/zookeeper"
+)
+
+import (

Review comment:
       挪到上面去




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-samples] AlexStocks commented on a change in pull request #81: Ftr/dubbo3

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on a change in pull request #81:
URL: https://github.com/apache/dubbo-go-samples/pull/81#discussion_r611165245



##########
File path: router/uniform-router/file/go-client/conf/virtual_service.yml
##########
@@ -0,0 +1,22 @@
+apiVersion: service.dubbo.apache.org/v1alpha1

Review comment:
       加上半角空格




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-samples] AlexStocks commented on a change in pull request #81: Ftr/dubbo3

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on a change in pull request #81:
URL: https://github.com/apache/dubbo-go-samples/pull/81#discussion_r611164968



##########
File path: general/dubbo3/hessian2/go-client/pkg/hello.go
##########
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package pkg
+
+import (
+	"context"
+	"time"
+)
+
+type User struct {
+	Id   string

Review comment:
       Id -> ID




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-samples] AlexStocks commented on a change in pull request #81: Ftr/dubbo3

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on a change in pull request #81:
URL: https://github.com/apache/dubbo-go-samples/pull/81#discussion_r611165156



##########
File path: router/uniform-router/file/README_zh.md
##########
@@ -0,0 +1,105 @@
+# 使用 Dubbbogo 统一路由规则 示例
+
+## 1. 路由规则文件注解
+
+路由规则只针对客户端,对于服务端,只需要在服务提供时打好特定的参数标签即可。
+
+### 1.1 virtual-service
+go-client/conf/virtual_service.yml
+
+```yaml
+apiVersion: service.dubbo.apache.org/v1alpha1
+kind: VirtualService
+metadata: {name: demo-route}
+spec:
+  dubbo:
+    # 使用正则表达式匹配service名,只有个满足该service名的请求才能路由。
+    # 就此例子来说,不满足service名的请求会直接找不到provider
+    - services:
+        - { regex: org.apache.dubbo.UserProvider* }
+    - routedetail:
+        # 匹配规则,如果(sourceLabel)客户端url满足存在参数 `trafficLabel: xxx` 的才能匹配成功
+        - match:
+            - sourceLabels: {trafficLabel: xxx}
+          name: other-condition
+          route: # 一旦匹配上述match规则,将选择dest_rule.yml里定义的名为other的子集
+            - destination: {host: demo, subset: other}
+        - name: center-match
+          # 没有match,兜底逻辑,一定会被匹配到。
+          route: # 将选择dest_rule.yml里定义的名为center的子集
+            - destination: {host: demo, subset: center}
+
+  hosts: [demo]  # 匹配dest_rule.yml里面的host
+
+```
+
+### 1.2 destination-rule
+go-client/conf/dest_rule.yml
+
+```yaml
+apiVersion: service.dubbo.apache.org/v1alpha1
+kind: DestinationRule
+metadata: { name: demo-route }
+spec:
+  host: demo
+  subsets:
+    - name: all
+      labels: { ut: CENTER } # 选中:服务端url存在 `ut:CENTER` 的键值参数的所有实例作为子集
+    - name: center
+      labels: { ut: other } # 选中:服务端url存在 `ut:other` 的键值参数的所有实例作为子集
+    - name: other # 无条件,选择所有实例
+```
+
+## 2. client、server 路由参数设置
+- client 端
+在本例子中,go-client/conf/client.yml 可看到如下注释
+```yaml
+# reference config
+references:
+  "UserProvider":
+    registry: "demoZk"
+    protocol: "dubbo"
+    interface: "org.apache.dubbo.UserProvider"
+    params: { trafficLabel: xxx }
+# If this line is comment, the all requests would be send to server, else the request would
+# be sent to both server and server2
+```
+可见,params对于客户端url参数的定义,一旦增加这个参数,根据上述配置的路由规则,就会命中上述destination 名为 other的子集,从而对所有provider 采用负载均衡策略发起调用。\

Review comment:
       加上半角空格。




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-samples] AlexStocks commented on a change in pull request #81: Ftr/dubbo3

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on a change in pull request #81:
URL: https://github.com/apache/dubbo-go-samples/pull/81#discussion_r611164766



##########
File path: general/dubbo3/README_zh.md
##########
@@ -0,0 +1,24 @@
+# Triple-go(Dubbo-go3.0) 示例

Review comment:
       记住中文文档,英文、阿拉伯数字和中文之间前后各加上一个半角空格【英文空格】。




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-samples] AlexStocks commented on a change in pull request #81: Ftr/dubbo3

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on a change in pull request #81:
URL: https://github.com/apache/dubbo-go-samples/pull/81#discussion_r611165322



##########
File path: router/uniform-router/k8s/README_zh.md
##########
@@ -0,0 +1,39 @@
+# K8S集群内使用 Dubbbogo 统一路由规则 示例

Review comment:
       通篇加上半角空格




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org