You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/07/23 20:34:11 UTC
[GitHub] [pulsar] david-streamlio opened a new issue #11448: Delayed message delivery doesn't work in Python.
david-streamlio opened a new issue #11448:
URL: https://github.com/apache/pulsar/issues/11448
**Describe the bug**
Messages sent using the Python client, 2.6.3 that specify a value in the deliver_after parameter are delivered immediately to any attached consumer.
**To Reproduce**
Steps to reproduce the behavior:
1. Start a consumer in a separate thread that is consuming from a topic
2. Run the code below to publish messages to the same topic
3. Observe that the consumer immediate processes the messages that were supposed to be delayed.
**Expected behavior**
The messages that were sent were supposed to be delivered at a later point in time.
**Screenshots**
**Desktop (please complete the following information):**
- OS: MacBook Pro
- Python3.8
- Pulsar-client 2.6.3 (anything higher doesn't work)
**Additional context**
== = Consumer code =====
client = pulsar.Client('pulsar://localhost:6650')
consumer = client.subscribe(
'persistent://public/default/my-topic',
'my-subscription',
consumer_type=pulsar.ConsumerType.Exclusive,
initial_position=pulsar.InitialPosition.Latest,
message_listener=None,
negative_ack_redelivery_delay_ms=60000)
while True:
msg = consumer.receive()
try:
print("Received message '%s' id='%s'", msg.data().decode('utf-8'), msg.message_id())
if msg.properties() is not None:
print(msg.properties())
consumer.acknowledge(msg)
except:
consumer.negative_acknowledge(msg)
client.close()
=== Producer code =====
client = pulsar.Client('pulsar://localhost:6650')
producer = client.create_producer(
'persistent://public/default/my-topic',
producer_name='delayed-python-producer')
for i in range(10):
producer.send(
('Hello-in-the-future-%d' % i).encode('utf-8'),
properties={"key1": "delayed-5-hours"},
deliver_after=timedelta(hours=5))
client.close()
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] markcheney1 commented on issue #11448: Delayed message delivery doesn't work in Python.
Posted by GitBox <gi...@apache.org>.
markcheney1 commented on issue #11448:
URL: https://github.com/apache/pulsar/issues/11448#issuecomment-982351290
pulsar.ConsumerType.Exclusive not support delayed message,you can try share mode
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] codelipenghui commented on issue #11448: Delayed message delivery doesn't work in Python.
Posted by GitBox <gi...@apache.org>.
codelipenghui commented on issue #11448:
URL: https://github.com/apache/pulsar/issues/11448#issuecomment-1058887855
The issue had no activity for 30 days, mark with Stale label.
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] markcheney1 edited a comment on issue #11448: Delayed message delivery doesn't work in Python.
Posted by GitBox <gi...@apache.org>.
markcheney1 edited a comment on issue #11448:
URL: https://github.com/apache/pulsar/issues/11448#issuecomment-982351290
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org