Skip to content

Commit

Permalink
🐛 修复路由解析结果中存在非GRPC协议实例 (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
lingting committed Mar 27, 2024
1 parent 84637ca commit 0e27a4a
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,12 @@ private void doWatch(Listener2 listener) {

private void notifyListener(Listener2 listener, InstancesResponse response) {
ServiceInstances serviceInstances = response.toServiceInstances();
List<EquivalentAddressGroup> equivalentAddressGroups = serviceInstances.getInstances()
.stream()
.map(this::buildEquivalentAddressGroup)
.collect(Collectors.toList());
List<EquivalentAddressGroup> equivalentAddressGroups = new ArrayList<>();
for (Instance instance : serviceInstances.getInstances()) {
if (Objects.equals("grpc", instance.getProtocol())) {
equivalentAddressGroups.add(buildEquivalentAddressGroup(instance));
}
}

Attributes.Builder builder = Attributes.newBuilder();

Expand Down

0 comments on commit 0e27a4a

Please # to comment.