BewareMyPower commented on code in PR #277:
URL:
https://github.com/apache/pulsar-client-python/pull/277#discussion_r2643211475
##########
pulsar/asyncio.py:
##########
@@ -127,14 +306,93 @@ def __init__(self, service_url, **kwargs) -> None:
"""
self._client: _pulsar.Client = pulsar.Client(service_url,
**kwargs)._client
- async def create_producer(self, topic: str) -> Producer:
+ # pylint:
disable=too-many-arguments,too-many-locals,too-many-positional-arguments
+ async def create_producer(self, topic: str,
+ producer_name: str | None = None,
+ schema: pulsar.schema.Schema | None = None,
+ initial_sequence_id: int | None = None,
+ send_timeout_millis: int = 30000,
+ compression_type: CompressionType =
CompressionType.NONE,
+ max_pending_messages: int = 1000,
+ max_pending_messages_across_partitions: int =
50000,
+ block_if_queue_full: bool = False,
+ batching_enabled: bool = True,
+ batching_max_messages: int = 1000,
+ batching_max_allowed_size_in_bytes: int =
128*1024,
+ batching_max_publish_delay_ms: int = 10,
+ chunking_enabled: bool = False,
+ message_routing_mode: PartitionsRoutingMode =
+ PartitionsRoutingMode.RoundRobinDistribution,
+ lazy_start_partitioned_producers: bool = False,
+ properties: dict | None = None,
+ batching_type: BatchingType =
BatchingType.Default,
+ encryption_key: str | None = None,
+ crypto_key_reader: pulsar.CryptoKeyReader | None
= None,
+ access_mode: ProducerAccessMode =
ProducerAccessMode.Shared,
+ message_router: Callable[[pulsar.Message, int],
int] | None = None,
+ ) -> Producer:
"""
Create a new producer on a given topic
Parameters
----------
topic: str
The topic name
+ producer_name: str | None, default=None
+ Specify a name for the producer. If not assigned, the system will
+ generate a globally unique name which can be accessed with
+ `Producer.producer_name()`. When specifying a name, it is app to
+ the user to ensure that, for a given topic, the producer name is
+ unique across all Pulsar's clusters.
+ schema: pulsar.schema.Schema | None, default=None
+ Define the schema of the data that will be published by this
producer.
+ initial_sequence_id: int | None, default=None
+ Set the baseline for the sequence ids for messages published by
+ the producer.
+ send_timeout_millis: int, default=30000
+ If a message is not acknowledged by the server before the
+ send_timeout expires, an error will be reported.
+ compression_type: CompressionType, default=CompressionType.NONE
+ Set the compression type for the producer.
+ max_pending_messages: int, default=1000
+ Set the max size of the queue holding the messages pending to
+ receive an acknowledgment from the broker.
+ max_pending_messages_across_partitions: int, default=50000
+ Set the max size of the queue holding the messages pending to
+ receive an acknowledgment across partitions.
+ block_if_queue_full: bool, default=False
+ Set whether send operations should block when the outgoing
+ message queue is full.
+ batching_enabled: bool, default=True
Review Comment:
outdated
--
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]