apache / apache/rocketmq

Proxy should not return POP messages without receipt handles

Open Beginner friendly
#10,784 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

`ConsumerProcessor.filterPopResult` currently keeps a POP message in the returned result even when the broker response does not contain `PROPERTY_POP_CK` and `createHandle(...)` returns null:

```java
String handleString = createHandle(messageExt.getProperty(MessageConst.PROPERTY_POP_CK), messageExt.getCommitLogOffset());
if (handleString == null) {
log.error("[BUG] pop message from broker but handle is empty. requestHeader:{}, msg:{}", requestHeader, messageExt);
messageExtList.add(messageExt);
continue;
}
```

A POP client needs the receipt handle to ack, change invisible time, or return the message. Returning a message without a valid handle can make the client receive a message that it cannot complete correctly.

## Expected behavior

When a POP message is missing the receipt handle, Proxy should treat it as an invalid broker response and avoid returning that message to the client.

## Scope

Track 2 / Proxy runtime diagnostics and POP correctness. This is separate from #10728, which only tracks raw `MessageExt` logging redaction and explicitly avoids behavior changes.

## Evidence

- `proxy/src/main/java/org/apache/rocketmq/proxy/processor/ConsumerProcessor.java`
- `createHandle(...)` returns null when `PROPERTY_POP_CK` is missing.
- `filterPopResult(...)` currently logs the bug but still appends the invalid message to the returned list.

Contributor guide

Open the contributing guide

Research direction

Start in proxy/src/main/java/org/apache/rocketmq/proxy/processor/ConsumerProcessor.java and read filterPopResult(...) alongside createHandle(...). Trace the missing PROPERTY_POP_CK path and verify that a message with a null handle is excluded from the returned result. Done means POP clients no longer receive messages they cannot acknowledge or otherwise complete.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.