Skip to content

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

Merged
BewareMyPower merged 1 commit into
apache:mainfrom
BewareMyPower:bewaremypower/msg-id-wrapper
May 6, 2025
Merged

Support constructing MessageId from results of send() and receive()#254
BewareMyPower merged 1 commit into
apache:mainfrom
BewareMyPower:bewaremypower/msg-id-wrapper

Conversation

@BewareMyPower

@BewareMyPower BewareMyPower commented May 6, 2025

Copy link
Copy Markdown
Contributor

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
@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

2 participants