Skip to content

Improve asynchronous producer with more options for creation and send - #280

Merged
BewareMyPower merged 2 commits into
apache:mainfrom
BewareMyPower:bewaremypower/asyncio-producer
Dec 24, 2025
Merged

Improve asynchronous producer with more options for creation and send#280
BewareMyPower merged 2 commits into
apache:mainfrom
BewareMyPower:bewaremypower/asyncio-producer

Conversation

@BewareMyPower

Copy link
Copy Markdown
Contributor

Fixes#261

@BewareMyPower
BewareMyPower marked this pull request as draft December 24, 2025 08:22
@BewareMyPowerBewareMyPower self-assigned this Dec 24, 2025
@BewareMyPowerBewareMyPower added this to the 3.9.0 milestone Dec 24, 2025
@BewareMyPower

Copy link
Copy Markdown
ContributorAuthor

This PR is based on #277, so wait for #277 to be merged first

@BewareMyPower
BewareMyPowerforce-pushed the bewaremypower/asyncio-producer branch from 76c5bff to dcc82feCompareDecember 24, 2025 08:45
@BewareMyPower
BewareMyPower marked this pull request as ready for review December 24, 2025 08:47

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the asyncio producer API with additional configuration options and message sending capabilities to align with the synchronous producer API. It adds support for message properties, routing keys, delayed delivery, flush operations, and exposes producer metadata methods.

Key changes:

  • Extended Producer.send() with parameters for properties, partition/ordering keys, sequence IDs, replication settings, and delayed delivery
  • Added Producer.flush() method for asynchronous batch flushing
  • Exposed producer metadata via topic(), producer_name(), and last_sequence_id() methods
  • Enhanced Client.create_producer() with comprehensive configuration options including batching, compression, encryption, access modes, and message routing

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

FileDescription
tests/asyncio_test.pyAdded tests for producer name/topic retrieval, keyed message sending with properties, and flush functionality with batching validation
src/producer.ccAdded Python binding for flush_async method to enable asynchronous flush operations
pulsar/asyncio.pyExtended Producer class with send options, flush method, and metadata accessors; enhanced Client.create_producer() with comprehensive configuration parameters matching the synchronous API

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadpulsar/asyncio.py Outdated
Comment threadpulsar/asyncio.py Outdated
Comment threadpulsar/asyncio.py Outdated
Comment threadpulsar/asyncio.py Outdated
@BewareMyPower
BewareMyPower merged commit 9432cb8 into apache:mainDec 24, 2025
16 of 18 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Expose create_producer Parameters in pulsar.asyncio.Client

3 participants

@BewareMyPower@RobertIndie