New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ServiceBusReceiver.peek_messages when receive_mode=ServiceBusReceiveMode.RECEIVE_AND_DELETE, consumes 1 message. #31712
Comments
@lubomirmatus Im trying to reproduce this and I wanted to clarify a few things. Assuming my topic/subscription has 100 messages I should see the following behavior
|
Hi @lubomirmatus. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue. |
Hi @kashifkhan When you have 100 messages in topic:
|
Thank you @lubomirmatus . I'm able to reproduce this on my end and will update this thread once we have a fix in place. |
@lubomirmatus just out of curiosity, we were wondering why set |
I have been performing debugging/tests of our system. In some points of code I wanted to see messages in the topic before they have been received and processed so I used peek to see them but not touch them. The recevier was created with |
Thank you for the update @lubomirmatus . We are able to reproduce this and will update when the fix will go in |
Hi @lubomirmatus - We've found the bug and are currently working on the right fix. We'll keep you updated as continue to work on it. Thanks! More info: Our default prefetch behavior should be "off". However, even when it's off, we're currently prefetching a message. |
Hi @lubomirmatus - We've merged the fix into the main branch of the repo. We will be releasing the fix this week. If you'd like to test out the change beforehand, you can build the wheel off of the main branch. Thanks! |
Hi @lubomirmatus - The fix has been released - https://pypi.org/project/azure-servicebus/7.11.3/ Thanks! |
Ok, thank you. |
Describe the bug
ServiceBusReceiver with
receive_mode=ServiceBusReceiveMode.RECEIVE_AND_DELETE
methodpeek_messages
consumes 1 message from topic/subscription. Whenreceive_mode=ServiceBusReceiveMode.PEEK_LOCK
then methodpeek_messages
is working OK.This behavior was spotted in
azure-servicebus
7.1.11
, for example older version7.8.2
was OK.To Reproduce
client = ServiceBusClient.from_connection_string(conn_str='my_connection', logging_enable=False)
receiver = client.get_subscription_receiver(topic_name='my_topic', subscription_name='my_subscription', receive_mode=ServiceBusReceiveMode.RECEIVE_AND_DELETE, keep_alive=0, prefetch_count=0)
messages = receiver.peek_messages(max_message_count=1000, timeout=10)
# Peeks messages and consumes 1st message from topic.Expected behavior
The method
peek_messages
should not modify topic and consume/delete messages.The text was updated successfully, but these errors were encountered: