jxplus opened a new issue, #10028:
URL: https://github.com/apache/dubbo/issues/10028
jdk:1.8
dubbo:2.7.15
协议:grpc
写了个列表查询接口,
provider端实现:
```java
public void list(SearchUserRequest request, StreamObserver<UserResponse>
responseObserver) {
users.forEach(c -> {
UserResponse ur =
UserResponse.newBuilder().setId(c.getId()).setName(c.getName()).build();
responseObserver.onNext(ur);
});
responseObserver.onCompleted();
}
```
consumer端调用:
```java
SearchUserRequest request = SearchUserRequest.newBuilder().build();
Iterator<UserResponse> responseIterator = userService.list(request);
responseIterator.forEachRemaining(item -> {
String str = String.format("user[id=%d, name=%s]", item.getId(),
item.getName());
System.out.println(str);
});
```
先启动provider,然后再起consumer,有时正常,有时还是报这个错,求解。
_Originally posted by @jxplus in
https://github.com/apache/dubbo/issues/6797#issuecomment-1123394458_
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]