jiangmocc opened a new pull request, #1499: URL: https://github.com/apache/pulsar-client-go/pull/1499
### Motivation Fixes #1498. Transactional sends already set the transaction id on `CommandSend`, but the serialized `MessageMetadata` did not carry `txnid_most_bits` and `txnid_least_bits`. Brokers rely on the message metadata transaction id when handling transaction buffer entries, so aborted transactional publishes can leak as visible messages. ### Modifications - Set transaction id fields on `MessageMetadata` for single-message transactional sends. - Set transaction id fields on batch-level `MessageMetadata` for transactional batches. - Clear transaction id fields from reusable batch metadata and send command state after flushing. - Add focused unit tests for single-message metadata, batch metadata, and batch reset behavior. ### Verifying this change - [x] `GOWORK=off go test -v ./pulsar/internal -run "TestBatchBuilder(AddsTxnIDToMessageMetadata|ClearsTxnIDAfterFlush)" -count=1` - [x] `GOWORK=off go test -v ./pulsar -run TestUpdateMetaDataAddsTxnID -count=1` ### Does this pull request potentially affect one of the following parts: - Dependencies: no - The public API: no - The schema: no - The default values of configurations: no - The wire protocol: no ### Documentation - Does this pull request introduce a new feature? no -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
