Skip to content
Permalink
Browse files
Add void sample
  • Loading branch information
guohao committed Aug 26, 2021
1 parent 968ccb4 commit bc03fc59d27e7e3d03133ff231c5525e2d73ff36
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
@@ -43,12 +43,22 @@ public static void main(String[] args) throws InterruptedException {
iGreeter = ref.get();
System.out.println("dubbo ref started");
sayHelloUnary();
sayHelloUnaryResponseVoid();
sayHelloUnaryRequestVoid();
sayHelloLong();
sayHelloException();
sayHelloStream();
sayHelloServerStream();
}

public static void sayHelloUnaryRequestVoid() {
System.out.println(iGreeter.sayHelloRequestVoid());
}

public static void sayHelloUnaryResponseVoid() {
iGreeter.sayHelloResponseVoid("void");
}

public static void sayHelloUnary() {
System.out.println(iGreeter.sayHello("unary"));
}
@@ -29,6 +29,10 @@ public interface IGreeter2 {

String sayHello(String request);

void sayHelloResponseVoid(String request);

String sayHelloRequestVoid();

String sayHelloException(String request);

String sayHelloWithAttachment(String request);
@@ -36,6 +36,15 @@ public String sayHello(String request) {
return "hello," + request;
}

@Override
public void sayHelloResponseVoid(String request) {
}

@Override
public String sayHelloRequestVoid() {
return "hello!";
}

@Override
public String sayHelloException(String request) {
throw new RuntimeException("Biz exception");

0 comments on commit bc03fc5

Please sign in to comment.