GitHub user shibd edited a comment on the discussion: what mean "Since it is the consumers instead of the broker who dispatch the messages from the batches"?
> mean "consumers dispatch message to other consumer"?? No, The `consumers` here refer to the [objects](https://github.com/shibd/pulsar/blob/c875977340eb76cab62de68442ba6238866d9643/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java#L57) used inside the broker to dispatch messages. > the key of the first message in one batch is considered as the key to all > messages in this batch, thereby leading to context errors You can read this passage. In `batchMsg`, the broker will only extract the key of the first message to [select the consumer](https://github.com/apache/pulsar/blob/c875977340eb76cab62de68442ba6238866d9643/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java#L218-L219). Therefore, when the message's key in the batch is inconsistent, the consumer may receive the inconsistent key message. GitHub link: https://github.com/apache/pulsar/discussions/19516#discussioncomment-5072775 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected]
