apache / apache/rocketmq

[Bug] Proxy gRPC queryRoute stops processing queues after a missing broker entry

Open Beginner friendly
#10,768 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
22.6k
Forks
12k
Avg merge
3d 1h
Merged PRs (30d)
27

Description

### Problem

`RouteActivity#queryRoute` stops iterating all queue data when one queue row has no matching broker entry in the built broker map.

Current code:

```java
Map brokerIdMap = brokerMap.get(brokerName);
if (brokerIdMap == null) {
break;
}
```

Because this uses `break`, a single malformed or stale `QueueData` entry can truncate the whole route response and hide later valid queues.

### Expected behavior

A missing broker entry should only skip that malformed queue row. The proxy should continue processing remaining queue rows that still have valid broker mappings.

### Impact

This can produce partial or empty gRPC `QueryRoute` responses when route metadata contains a stale queue row before valid rows. That affects Proxy/gRPC route discovery and can make clients miss usable queues.

### Suggested fix

Change the missing broker-map path from `break` to `continue` and add a regression test with:

- one queue row whose broker name is absent from `brokerMap`
- one later queue row with a valid broker mapping
- assertion that the valid later queue still appears in the query route response

Contributor guide

Open the contributing guide

Research direction

Start at RouteActivity#queryRoute and trace how brokerMap and queue data are processed. Add the regression test described in the issue, then verify that a later queue with a valid broker mapping still appears in the gRPC QueryRoute response after an earlier missing mapping.

Written by the indexing model from the issue text.

Assessment

Tech stack
grpc, java
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.