You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "wangchengming666 (via GitHub)" <gi...@apache.org> on 2026/01/02 14:49:21 UTC

[PR] sample for triple backpressure [dubbo-samples]

wangchengming666 opened a new pull request, #1278:
URL: https://github.com/apache/dubbo-samples/pull/1278

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

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


Re: [PR] sample for triple backpressure [dubbo-samples]

Posted by "EarthChen (via GitHub)" <gi...@apache.org>.
EarthChen merged PR #1278:
URL: https://github.com/apache/dubbo-samples/pull/1278


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


Re: [PR] sample for triple backpressure [dubbo-samples]

Posted by "zrlw (via GitHub)" <gi...@apache.org>.
zrlw commented on PR #1278:
URL: https://github.com/apache/dubbo-samples/pull/1278#issuecomment-3707814164

   1. we had a great effort to remove```System.out.printXXX``` codes for performance reason,  we should use log.info for logging message.
   2. since this pr is written for https://github.com/apache/dubbo/pull/15957, but i don't see the difference whether applying with https://github.com/apache/dubbo/pull/15957 or not.


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


Re: [PR] sample for triple backpressure [dubbo-samples]

Posted by "zrlw (via GitHub)" <gi...@apache.org>.
zrlw commented on code in PR #1278:
URL: https://github.com/apache/dubbo-samples/pull/1278#discussion_r2659462942


##########
2-advanced/dubbo-samples-triple-backpressure/src/main/java/org/apache/dubbo/samples/backpressure/BackpressureConsumer.java:
##########
@@ -0,0 +1,331 @@
+/*
+ * 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 org.apache.dubbo.samples.backpressure;
+
+import org.apache.dubbo.common.stream.StreamObserver;
+import org.apache.dubbo.config.ApplicationConfig;
+import org.apache.dubbo.config.ReferenceConfig;
+import org.apache.dubbo.config.RegistryConfig;
+import org.apache.dubbo.config.bootstrap.DubboBootstrap;
+import org.apache.dubbo.rpc.protocol.tri.CancelableStreamObserver;
+import org.apache.dubbo.rpc.protocol.tri.observer.ClientCallToObserverAdapter;
+import org.apache.dubbo.samples.backpressure.api.BackpressureService;
+import org.apache.dubbo.samples.backpressure.api.DataChunk;
+import org.apache.dubbo.samples.backpressure.api.StreamRequest;
+import org.apache.dubbo.samples.backpressure.api.StreamResponse;
+
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicLong;
+
+public class BackpressureConsumer {
+
+    private static final String ZOOKEEPER_HOST = System.getProperty("zookeeper.address", "127.0.0.1");
+    private static final String ZOOKEEPER_PORT = System.getProperty("zookeeper.port", "2181");
+
+    public static void main(String[] args) throws Exception {
+        ReferenceConfig<BackpressureService> reference = new ReferenceConfig<>();
+        reference.setInterface(BackpressureService.class);
+        reference.setProtocol("tri");
+
+        String zkAddress = "zookeeper://" + ZOOKEEPER_HOST + ":" + ZOOKEEPER_PORT;
+        System.out.println("Using ZooKeeper: " + zkAddress);
+
+        DubboBootstrap bootstrap = DubboBootstrap.getInstance();
+        bootstrap.application(new ApplicationConfig("backpressure-consumer"))
+                .registry(new RegistryConfig(zkAddress))
+                .reference(reference)
+                .start();
+
+        BackpressureService service = reference.get();
+
+        System.out.println("=== Test 1: Basic Echo ===");
+        testEcho(service);
+
+        System.out.println("\n=== Test 2: Server Stream WITHOUT Backpressure ===");

Review Comment:
   it might be better to use log.info for performance reason.



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