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 2022/07/18 03:47:33 UTC

[GitHub] [dubbo-samples] CrazyHZM commented on a diff in pull request #482: Dubbo samples mesh k8s: add envoy healthChecks

CrazyHZM commented on code in PR #482:
URL: https://github.com/apache/dubbo-samples/pull/482#discussion_r922953593


##########
dubbo-samples-mesh-k8s/dubbo-samples-mesh-consumer/pom.xml:
##########
@@ -63,6 +63,7 @@
             <groupId>org.apache.dubbo</groupId>
             <artifactId>dubbo</artifactId>
             <version>${dubbo.version}</version>
+            <!--            <version>3.1.0-SNAPSHOT</version>-->

Review Comment:
   Remove useless code.



##########
dubbo-samples-mesh-k8s/dubbo-samples-mesh-consumer/src/main/java/org/apache/dubbo/samples/ConsumerBootstrap.java:
##########
@@ -19,23 +19,28 @@
 
 package org.apache.dubbo.samples;
 
+import java.util.concurrent.atomic.AtomicInteger;
 import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
 import org.apache.dubbo.samples.action.GreetingServiceConsumer;
-
 import org.springframework.context.annotation.AnnotationConfigApplicationContext;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.PropertySource;
 
 public class ConsumerBootstrap {
 
-    public static void main(String[] args) {
+    public static void main(String[] args) throws InterruptedException {
         AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ConsumerConfiguration.class);
         context.start();
-        System.out.println("==================== dubbo invoke started ====================");
+        System.out.println("==================== dubbo invoke loop started ====================");
         GreetingServiceConsumer greetingServiceConsumer = context.getBean(GreetingServiceConsumer.class);
-        greetingServiceConsumer.doSayHello("Kubernetes Api Server");
-        System.out.println("==================== dubbo invoke end ====================");
+        AtomicInteger count = new AtomicInteger(0);
+        while (true) {
+            greetingServiceConsumer.doSayHello("service mesh");
+            System.out.println("==================== dubbo invoke " + count.get() + " end ====================");
+            count.getAndIncrement();
+            Thread.sleep(10000);
+        }

Review Comment:
   Don't loop endlessly.
   



##########
dubbo-samples-mesh-k8s/dubbo-samples-mesh-consumer/pom.xml:
##########
@@ -30,11 +30,11 @@
     <properties>
         <source.level>1.8</source.level>
         <target.level>1.8</target.level>
-        <dubbo.version>3.1.0-SNAPSHOT</dubbo.version>
+        <dubbo.version>3.0.7</dubbo.version>
         <spring.version>4.3.16.RELEASE</spring.version>
         <junit.version>4.12</junit.version>
         <maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
-        <grpc.version>1.44.0</grpc.version>
+        <grpc.version>1.31.1</grpc.version>

Review Comment:
   Don't change this version.



##########
dubbo-samples-mesh-k8s/dubbo-samples-mesh-consumer/src/main/java/org/apache/dubbo/samples/action/GreetingServiceConsumer.java:
##########
@@ -33,13 +33,14 @@ public class GreetingServiceConsumer {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(GreetingServiceConsumer.class);
 
-    @DubboReference(version = "1.0.0", providedBy = "dubbo-samples-mesh-provider", url = "tri://dubbo-samples-mesh-provider:50052")
+    @DubboReference(version = "1.0.0", providedBy = "dubbo-samples-mesh-provider", url = "tri://dubbo-samples-mesh-provider:50052", lazy = true)
+//    @DubboReference(version = "1.0.0", providedBy = "dubbo-samples-mesh-provider", url = "tri://localhost:50052")

Review Comment:
   Remove useless code.



##########
dubbo-samples-mesh-k8s/dubbo-samples-mesh-consumer/pom.xml:
##########
@@ -30,11 +30,11 @@
     <properties>
         <source.level>1.8</source.level>
         <target.level>1.8</target.level>
-        <dubbo.version>3.1.0-SNAPSHOT</dubbo.version>
+        <dubbo.version>3.0.7</dubbo.version>

Review Comment:
   Don't change this version.



##########
dubbo-samples-mesh-k8s/dubbo-samples-mesh-provider/pom.xml:
##########
@@ -11,8 +11,8 @@
     <properties>
         <source.level>1.8</source.level>
         <target.level>1.8</target.level>
-        <dubbo.version>3.1.0-SNAPSHOT</dubbo.version>
-        <grpc.version>1.44.0</grpc.version>
+        <dubbo.version>3.0.7</dubbo.version>
+        <grpc.version>1.31.1</grpc.version>

Review Comment:
   Don't change this version.



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

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