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/01/11 06:07:53 UTC
[incubator-dubbo-samples] branch samples-for-2.7.0-SNAPSHOT
updated: remove dependency on AsyncSignal
This is an automated email from the ASF dual-hosted git repository.
liujun pushed a commit to branch samples-for-2.7.0-SNAPSHOT
in repository https://gitbox.apache.org/repos/asf/incubator-dubbo-samples.git
The following commit(s) were added to refs/heads/samples-for-2.7.0-SNAPSHOT by this push:
new 25c72f7 remove dependency on AsyncSignal
25c72f7 is described below
commit 25c72f718719d14e2370811a2cbeabfff982b272
Author: ken.lj <ke...@gmail.com>
AuthorDate: Fri Jan 11 14:07:42 2019 +0800
remove dependency on AsyncSignal
---
.../main/java/org/apache/dubbo/samples/api/GreetingsService.java | 4 +---
.../java/org/apache/dubbo/samples/governance/AsyncConsumer.java | 6 +++---
.../apache/dubbo/samples/governance/filter/LegacyBlockFilter.java | 2 +-
3 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/dubbo-samples-api/src/main/java/org/apache/dubbo/samples/api/GreetingsService.java b/dubbo-samples-api/src/main/java/org/apache/dubbo/samples/api/GreetingsService.java
index cb002f5..45295b3 100644
--- a/dubbo-samples-api/src/main/java/org/apache/dubbo/samples/api/GreetingsService.java
+++ b/dubbo-samples-api/src/main/java/org/apache/dubbo/samples/api/GreetingsService.java
@@ -17,14 +17,12 @@
package org.apache.dubbo.samples.api;
-import com.alibaba.dubbo.config.async.AsyncSignal;
-
import java.util.concurrent.CompletableFuture;
public interface GreetingsService {
String sayHi(String name);
- default CompletableFuture<String> sayHi(String name, AsyncSignal signal) {
+ default CompletableFuture<String> sayHi(String name, byte signal) {
return CompletableFuture.completedFuture(sayHi(name));
}
}
diff --git a/dubbo-samples-async/dubbo-samples-async-generated-future/src/main/java/org/apache/dubbo/samples/governance/AsyncConsumer.java b/dubbo-samples-async/dubbo-samples-async-generated-future/src/main/java/org/apache/dubbo/samples/governance/AsyncConsumer.java
index 84359b0..5cbdd8b 100644
--- a/dubbo-samples-async/dubbo-samples-async-generated-future/src/main/java/org/apache/dubbo/samples/governance/AsyncConsumer.java
+++ b/dubbo-samples-async/dubbo-samples-async-generated-future/src/main/java/org/apache/dubbo/samples/governance/AsyncConsumer.java
@@ -21,8 +21,6 @@ package org.apache.dubbo.samples.governance;
import org.apache.dubbo.samples.api.GreetingsService;
-import com.alibaba.dubbo.config.async.AsyncSignal;
-
import org.springframework.context.support.ClassPathXmlApplicationContext;
import java.util.concurrent.CompletableFuture;
@@ -32,13 +30,15 @@ import java.util.concurrent.CompletableFuture;
*/
public class AsyncConsumer {
+ private static final byte SIGNAL = 1;
+
public static void main(String[] args) throws Exception {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"META-INF/spring/async-consumer.xml"});
context.start();
final GreetingsService greetingsService = (GreetingsService) context.getBean("greetingsService");
- CompletableFuture<String> future = greetingsService.sayHi("async call reqeust", AsyncSignal.SIGNAL);
+ CompletableFuture<String> future = greetingsService.sayHi("async call reqeust", SIGNAL);
System.out.println("async call ret :" + future.get());
System.out.println(greetingsService.sayHi("normal sync call request"));
diff --git a/dubbo-samples-async/dubbo-samples-async-original-future/src/main/java/org/apache/dubbo/samples/governance/filter/LegacyBlockFilter.java b/dubbo-samples-async/dubbo-samples-async-original-future/src/main/java/org/apache/dubbo/samples/governance/filter/LegacyBlockFilter.java
index b39f1db..43545f5 100644
--- a/dubbo-samples-async/dubbo-samples-async-original-future/src/main/java/org/apache/dubbo/samples/governance/filter/LegacyBlockFilter.java
+++ b/dubbo-samples-async/dubbo-samples-async-original-future/src/main/java/org/apache/dubbo/samples/governance/filter/LegacyBlockFilter.java
@@ -36,7 +36,7 @@ public class LegacyBlockFilter implements Filter {
if (result.hasException()) {
System.out.println("LegacyBlockFilter: This will only happen when the real exception returns: " + result.getException());
}
- System.err.println("LegacyBlockFilter: This msg should not be blocked.");
+ System.out.println("LegacyBlockFilter: This msg should not be blocked.");
return result;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org