AlexStocks commented on a change in pull request #82:
URL: https://github.com/apache/dubbo-go-samples/pull/82#discussion_r607120943



##########
File path: shopping-order/go-client/cmd/client.go
##########
@@ -0,0 +1,96 @@
+/*
+ * 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 main
+
+import (
+       "context"
+       "fmt"
+       "github.com/apache/dubbo-go-samples/shopping-order/go-client/pkg"

Review comment:
       move it to the 3rd import block.

##########
File path: shopping-order/go-server-order/cmd/server.go
##########
@@ -0,0 +1,111 @@
+/*
+ * 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 main
+
+import (
+       "database/sql"
+       "fmt"
+       "os"
+       "os/signal"
+       "syscall"
+       "time"
+)
+import (
+       _ "github.com/apache/dubbo-go/cluster/cluster_impl"
+       _ "github.com/apache/dubbo-go/cluster/loadbalance"
+       "github.com/apache/dubbo-go/common/logger"
+       _ "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/metadata/service/inmemory"
+       _ "github.com/apache/dubbo-go/protocol/dubbo"
+       _ "github.com/apache/dubbo-go/registry/protocol"
+       "github.com/transaction-wg/seata-golang/pkg/client"
+       "github.com/transaction-wg/seata-golang/pkg/client/at/exec"
+       seataConfig "github.com/transaction-wg/seata-golang/pkg/client/config"
+       //_ "github.com/apache/dubbo-go/registry/nacos"
+       _ "github.com/apache/dubbo-go/registry/zookeeper"
+)
+import (

Review comment:
       add blank line above

##########
File path: shopping-order/go-client/conf/seata.yml
##########
@@ -0,0 +1,23 @@
+application_id: "aggregation-svc"
+transaction_service_group: "127.0.0.1:8091"
+enable-client-batch-send-request: true
+seata_version: "1.2.0"
+getty:
+  reconnect_interval: 0
+  connection_number: 1
+  heartbeat_period: "10s"
+  getty_session_param:
+    compress_encoding: false
+    tcp_no_delay: true
+    tcp_keep_alive: true
+    keep_alive_period: "180s"
+    tcp_r_buf_size: 262144
+    tcp_w_buf_size: 65536
+    tcp_read_timeout: "1s"
+    tcp_write_timeout: "5s"
+    wait_timeout: "1s"
+    max_msg_len: 4096

Review comment:
       change it to 8388608

##########
File path: shopping-order/go-server-common/filter/seata_filter.go
##########
@@ -0,0 +1,45 @@
+package filter
+
+import (
+       "context"
+)
+import (
+       "github.com/apache/dubbo-go/common/extension"
+       "github.com/apache/dubbo-go/filter"
+       "github.com/apache/dubbo-go/protocol"
+)
+import (
+// inner
+)
+
+const (
+       SEATA     = "seata"
+       SEATA_XID = "seata_xid"
+)
+
+func init() {
+       extension.SetFilter(SEATA, getSeataFilter)
+}
+
+// SeataFilter ...
+type SeataFilter struct {
+}
+
+// Invoke ...

Review comment:
       add comment

##########
File path: shopping-order/go-server-order/conf/seata.yml
##########
@@ -0,0 +1,28 @@
+application_id: "order-svc"
+transaction_service_group: "127.0.0.1:8091"
+seata_version: "1.2.0"
+getty:
+  reconnect_interval: 0
+  connection_number: 1
+  heartbeat_period: "10s"
+  getty_session_param:
+    compress_encoding: false
+    tcp_no_delay: true
+    tcp_keep_alive: true
+    keep_alive_period: "180s"
+    tcp_r_buf_size: 262144
+    tcp_w_buf_size: 65536
+    tcp_read_timeout: "1s"
+    tcp_write_timeout: "5s"
+    wait_timeout: "1s"
+    max_msg_len: 4096

Review comment:
       change it to 8688608

##########
File path: shopping-order/go-server-common/filter/seata_filter.go
##########
@@ -0,0 +1,45 @@
+package filter
+
+import (
+       "context"
+)
+import (
+       "github.com/apache/dubbo-go/common/extension"
+       "github.com/apache/dubbo-go/filter"
+       "github.com/apache/dubbo-go/protocol"
+)
+import (
+// inner
+)
+
+const (
+       SEATA     = "seata"
+       SEATA_XID = "seata_xid"
+)
+
+func init() {
+       extension.SetFilter(SEATA, getSeataFilter)
+}
+
+// SeataFilter ...

Review comment:
       // nolint

##########
File path: shopping-order/go-server-common/filter/seata_filter.go
##########
@@ -0,0 +1,45 @@
+package filter
+
+import (
+       "context"
+)
+import (
+       "github.com/apache/dubbo-go/common/extension"
+       "github.com/apache/dubbo-go/filter"
+       "github.com/apache/dubbo-go/protocol"
+)
+import (
+// inner
+)
+
+const (
+       SEATA     = "seata"
+       SEATA_XID = "seata_xid"
+)
+
+func init() {
+       extension.SetFilter(SEATA, getSeataFilter)
+}
+
+// SeataFilter ...
+type SeataFilter struct {
+}
+
+// Invoke ...
+func (sf *SeataFilter) Invoke(ctx context.Context, invoker protocol.Invoker, 
invocation protocol.Invocation) protocol.Result {
+       xid := invocation.AttachmentsByKey(SEATA_XID, "")
+       if xid != "" {
+               return invoker.Invoke(context.WithValue(ctx, SEATA_XID, xid), 
invocation)
+       }
+       return invoker.Invoke(ctx, invocation)
+}
+
+// OnResponse ...

Review comment:
       add comment

##########
File path: shopping-order/go-server-order/conf/server.yml
##########
@@ -0,0 +1,51 @@
+application:
+  organization: "dubbo.io"
+  name: "BDTService"
+  module: "dubbogo shopping-order server"
+  version: "0.0.1"
+  environment: "dev"
+
+registries:
+  "demoZk":
+    protocol: "zookeeper"
+    timeout: "3s"
+    address: "127.0.0.1:2181"
+
+filter: "seata"
+
+services:
+  "OrderSvc":
+    registry: "demoZk"
+    protocol: "dubbo"
+    interface: "org.apache.dubbo.OrderSvc"
+    loadbalance: "random"
+    warmup: "100"
+    cluster: "failover"
+    methods:
+      - name: "CreateSo"
+        retries: 1
+        loadbalance: "random"
+
+protocols:
+  "dubbo":
+    name: "dubbo"
+    port: 20000
+
+protocol_conf:
+  dubbo:
+    session_number: 700
+    session_timeout: "20s"
+    getty_session_param:
+      compress_encoding: false
+      tcp_no_delay: true
+      tcp_keep_alive: true
+      keep_alive_period: "120s"
+      tcp_r_buf_size: 262144
+      tcp_w_buf_size: 65536
+      pkg_rq_size: 1024
+      pkg_wq_size: 512
+      tcp_read_timeout: "1s"
+      tcp_write_timeout: "5s"
+      wait_timeout: "1s"
+      max_msg_len: 1024

Review comment:
       change it to 8388608

##########
File path: shopping-order/go-server-product/cmd/server.go
##########
@@ -0,0 +1,112 @@
+/*
+ * 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 main
+
+import (
+       "database/sql"
+       "fmt"
+       "os"
+       "os/signal"
+       "syscall"
+       "time"
+)

Review comment:
       pls add blank line btw import block.

##########
File path: shopping-order/go-server-common/filter/seata_filter.go
##########
@@ -0,0 +1,45 @@
+package filter
+
+import (
+       "context"
+)
+import (
+       "github.com/apache/dubbo-go/common/extension"
+       "github.com/apache/dubbo-go/filter"
+       "github.com/apache/dubbo-go/protocol"
+)
+import (
+// inner
+)
+
+const (
+       SEATA     = "seata"
+       SEATA_XID = "seata_xid"
+)
+
+func init() {
+       extension.SetFilter(SEATA, getSeataFilter)
+}
+
+// SeataFilter ...
+type SeataFilter struct {
+}
+
+// Invoke ...
+func (sf *SeataFilter) Invoke(ctx context.Context, invoker protocol.Invoker, 
invocation protocol.Invocation) protocol.Result {
+       xid := invocation.AttachmentsByKey(SEATA_XID, "")
+       if xid != "" {
+               return invoker.Invoke(context.WithValue(ctx, SEATA_XID, xid), 
invocation)
+       }
+       return invoker.Invoke(ctx, invocation)
+}
+
+// OnResponse ...
+func (sf *SeataFilter) OnResponse(ctx context.Context, result protocol.Result, 
invoker protocol.Invoker, invocation protocol.Invocation) protocol.Result {
+       return result
+}
+
+// GetSeataFilter ...

Review comment:
       delete this comment

##########
File path: shopping-order/go-client/conf/client.yml
##########
@@ -0,0 +1,63 @@
+check: true
+request_timeout: "3s"
+connect_timeout: "3s"
+
+application:
+  organization: "dubbo.io"
+  name: "BDTService"
+  module: "dubbogo user-info client"
+  version: "0.0.1"
+  environment: "dev"
+
+registries:
+  "demoZk":
+    protocol: "zookeeper"
+    timeout: "3s"
+    address: "127.0.0.1:2181"
+#  "nacos":
+#    protocol: "nacos"
+#    timeout: "3s"
+#    address: "nacos:8848"
+
+references:
+  "OrderSvc":
+    registry: "demoZk"
+    protocol: "dubbo"
+    interface: "org.apache.dubbo.OrderSvc"
+    cluster: "failover"
+    url: "dubbo://127.0.0.1:20000"
+    methods:
+      - name: "CreateSo"
+        retries: 3
+  "ProductSvc":
+    registry: "demoZk"
+    protocol: "dubbo"
+    interface: "org.apache.dubbo.ProductSvc"
+    cluster: "failover"
+    url: "dubbo://127.0.0.1:20001"
+    methods:
+      - name: "AllocateInventory"
+        retries: 3
+
+protocol_conf:
+  dubbo:
+    reconnect_interval: 0
+    connection_number: 2
+    heartbeat_period: "5s"
+    session_timeout: "20s"
+    pool_size: 64
+    pool_ttl: 600
+    getty_session_param:
+      compress_encoding: false
+      tcp_no_delay: true
+      tcp_keep_alive: true
+      keep_alive_period: "120s"
+      tcp_r_buf_size: 262144
+      tcp_w_buf_size: 65536
+      pkg_rq_size: 1024
+      pkg_wq_size: 512
+      tcp_read_timeout: "1s"
+      tcp_write_timeout: "5s"
+      wait_timeout: "1s"
+      max_msg_len: 10240

Review comment:
       change it to 8388608 which is  8MiB

##########
File path: shopping-order/go-server-common/filter/seata_filter.go
##########
@@ -0,0 +1,45 @@
+package filter
+
+import (
+       "context"
+)
+import (
+       "github.com/apache/dubbo-go/common/extension"
+       "github.com/apache/dubbo-go/filter"
+       "github.com/apache/dubbo-go/protocol"
+)
+import (

Review comment:
       delete this blank import block.

##########
File path: shopping-order/go-server-product/cmd/server.go
##########
@@ -0,0 +1,112 @@
+/*
+ * 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 main
+
+import (
+       "database/sql"
+       "fmt"
+       "os"
+       "os/signal"
+       "syscall"
+       "time"
+)
+import (
+       _ "github.com/apache/dubbo-go/cluster/cluster_impl"
+       _ "github.com/apache/dubbo-go/cluster/loadbalance"
+       "github.com/apache/dubbo-go/common/logger"
+       _ "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/metadata/service/inmemory"
+       _ "github.com/apache/dubbo-go/protocol/dubbo"
+       _ "github.com/apache/dubbo-go/registry/protocol"
+       "github.com/transaction-wg/seata-golang/pkg/client"
+       "github.com/transaction-wg/seata-golang/pkg/client/at/exec"
+       seataConfig "github.com/transaction-wg/seata-golang/pkg/client/config"
+       //_ "github.com/apache/dubbo-go/registry/nacos"
+       _ "github.com/apache/dubbo-go/registry/zookeeper"
+)
+import (

Review comment:
       add blank line above

##########
File path: shopping-order/go-server-common/filter/seata_filter.go
##########
@@ -0,0 +1,45 @@
+package filter
+
+import (
+       "context"
+)
+import (

Review comment:
       add blank above.

##########
File path: shopping-order/go-server-product/conf/seata.yml
##########
@@ -0,0 +1,30 @@
+application_id: "product-svc"
+transaction_service_group: "127.0.0.1:8091"
+
+seata_version: "1.2.0"
+
+getty:
+  reconnect_interval: 0
+  connection_number: 1
+  heartbeat_period: "10s"
+  getty_session_param:
+    compress_encoding: false
+    tcp_no_delay: true
+    tcp_keep_alive: true
+    keep_alive_period: "180s"
+    tcp_r_buf_size: 262144
+    tcp_w_buf_size: 65536
+    tcp_read_timeout: "1s"
+    tcp_write_timeout: "5s"
+    wait_timeout: "1s"
+    max_msg_len: 4096

Review comment:
       change it to 8388608

##########
File path: shopping-order/go-server-product/conf/server.yml
##########
@@ -0,0 +1,55 @@
+application:
+  organization: "dubbo.io"
+  name: "BDTService"
+  module: "dubbogo shopping-product server"
+  version: "0.0.1"
+  environment: "dev"
+
+registries:
+  "demoZk":
+    protocol: "zookeeper"
+    timeout: "3s"
+    address: "127.0.0.1:2181"
+#  "nacos":
+#    protocol: "nacos"
+#    timeout: "3s"
+#    address: "nacos:8848"
+
+filter: "seata"
+
+services:
+  "ProductSvc":
+    registry: "demoZk"
+    protocol: "dubbo"
+    interface: "org.apache.dubbo.ProductSvc"
+    loadbalance: "random"
+    warmup: "100"
+    cluster: "failover"
+    methods:
+      - name: "AllocateInventory"
+        retries: 1
+        loadbalance: "random"
+
+protocols:
+  "dubbo":
+    name: "dubbo"
+    port: 20001
+
+protocol_conf:
+  dubbo:
+    session_number: 700
+    session_timeout: "20s"
+    getty_session_param:
+      compress_encoding: false
+      tcp_no_delay: true
+      tcp_keep_alive: true
+      keep_alive_period: "120s"
+      tcp_r_buf_size: 262144
+      tcp_w_buf_size: 65536
+      pkg_rq_size: 1024
+      pkg_wq_size: 512
+      tcp_read_timeout: "1s"
+      tcp_write_timeout: "5s"
+      wait_timeout: "1s"
+      max_msg_len: 1024

Review comment:
       change it to 8388608




-- 
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to