get the next sequence number (delivery tag)

40 views
Skip to first unread message

Madhur Tandon

unread,
Aug 24, 2023, 10:51:29 AM8/24/23
to Pika
Hi,

Noticed that several clients offer `channel.NextPublishSeqNo` or perhaps `ch.getNextPublishSeqNo()` to aid in implementing asynchronous publisher confirmations.

With `pika` however, in the example https://github.com/pika/pika/blob/main/examples/asynchronous_publisher_example.py

We use a counter basically, and increment it: https://github.com/pika/pika/blob/main/examples/asynchronous_publisher_example.py#L319C9-L319C34

Is this a good practice? I mean, there is no limit to this counter getting incremented.
Is there a function which offers us to get the next sequence number / delivery tag? Just like clients in other languages offer us?

Please let me know,
Thanks and Best Regards,
-- Madhur

Luke Bakken

unread,
Aug 29, 2023, 10:02:39 AM8/29/23
to Pika
Hello,

Using your own counter is the correct way with Pika. At this time Pika does not keep track internally of sequence numbers.

Thanks,
Luke

Reply all
Reply to author
Forward
0 new messages