Skip to content

Conversation

@BewareMyPower
Copy link
Owner

Motivation

For a multi-topics consumer, when it acknowledges a single message, it will first find the owner topic from its message ID. If the owner topic is not subscribed by the consumer, NotConnectedException will be thrown.

However, when it acknowledges multiple messages, if any of them is the message whose owner topic is not subscribed by the consumer, NPE will happen instead.

Modifications

When acknowledging multiple messages, ignore the message IDs whose owner topic is not subscribed. testAckMessageInAnotherTopic is added to cover this case.

TODO

There are many other places that do not check if consumers.get returns null, like doReconsumeLater, negativeAcknowledge, etc. This patch does not cover them.

### Motivation

For a multi-topics consumer, when it acknowledges a single message, it
will first find the owner topic from its message ID. If the owner topic
is not subscribed by the consumer, `NotConnectedException` will be
thrown.

However, when it acknowledges multiple messages, if any of them is the
message whose owner topic is not subscribed by the consumer, NPE will
happen instead.

### Modifications

When acknowledging multiple messages, ignore the message IDs whose owner
topic is not subscribed. `testAckMessageInAnotherTopic` is added to
cover this case.

### TODO

There are many other places that do not check if `consumers.get` returns
`null`, like `doReconsumeLater`, `negativeAcknowledge`, etc. This patch
does not cover them.
@github-actions
Copy link

The pr had no activity for 30 days, mark with Stale label.

@github-actions github-actions bot added the Stale label Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants