Skip to content

Support constructing MessageId from results of send() and receive() #254

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

BewareMyPower
Copy link
Contributor

@BewareMyPower BewareMyPower commented May 6, 2025

Currently, Producer.send returns a _pulsar.MessageId instance, Consumer.receive returns a MessageId whose message_id() method returns a _pulsar.MessageId instance. This forces users to access the type from the C extension module (_pulsar).

This patch adds a MessageId.wrap class method to convert the type from the C extension to the type in the pulsar module. In addition, it exposes the comparison methods for MessageId and allows accepting a MessageId instance for acknowledge and acknowledge_cumulative methods.

Currently, `Producer.send` returns a `_pulsar.MessageId` instance,
`Consumer.receive` returns a `MessageId` whose `message_id()` method
returns a `_pulsar.MessageId` instance. This forces users to access the
type from the C extension module (`_pulsar`).

This patch adds a `MessageId.wrap` class method to convert the type from
the C extension to the type in the `pulsar` module. It also exposes the
comparison methods for `MessageId`.
@BewareMyPower BewareMyPower self-assigned this May 6, 2025
@BewareMyPower BewareMyPower added this to the 3.7.0 milestone May 6, 2025
@BewareMyPower BewareMyPower added the enhancement New feature or request label May 6, 2025
@BewareMyPower BewareMyPower merged commit 581531a into apache:main May 6, 2025
11 checks passed
@BewareMyPower BewareMyPower deleted the bewaremypower/msg-id-wrapper branch May 6, 2025 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants