You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by li...@apache.org on 2019/07/11 10:22:48 UTC
[dubbo-samples] branch master updated: add RpcContext.getFuture
test to zipkin sample
This is an automated email from the ASF dual-hosted git repository.
liujun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-samples.git
The following commit(s) were added to refs/heads/master by this push:
new 2822ded add RpcContext.getFuture test to zipkin sample
2822ded is described below
commit 2822ded7d9eb638ab9ecfa6a28d29ff575537be0
Author: ken.lj <ke...@gmail.com>
AuthorDate: Thu Jul 11 18:22:35 2019 +0800
add RpcContext.getFuture test to zipkin sample
---
.../java/org/apache/dubbo/samples/client/Application.java | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/dubbo-samples-zipkin/src/main/java/org/apache/dubbo/samples/client/Application.java b/dubbo-samples-zipkin/src/main/java/org/apache/dubbo/samples/client/Application.java
index eb692ca..4aa0525 100644
--- a/dubbo-samples-zipkin/src/main/java/org/apache/dubbo/samples/client/Application.java
+++ b/dubbo-samples-zipkin/src/main/java/org/apache/dubbo/samples/client/Application.java
@@ -20,15 +20,23 @@
package org.apache.dubbo.samples.client;
import org.apache.dubbo.samples.api.GreetingService;
+
+import com.alibaba.dubbo.rpc.RpcContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
+import java.util.concurrent.Future;
+
public class Application {
- public static void main(String[] args) {
+ public static void main(String[] args) throws Exception {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring/client.xml");
context.start();
GreetingService greetingService = context.getBean("greetingService", GreetingService.class);
- System.out.println(greetingService.greeting("world"));
+
+ greetingService.greeting("world");
+ Future<?> future = RpcContext.getContext().getFuture();
+
+ System.out.println(future.get());
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org