question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Queue] QueueClient.receive_messages() doesn't react to `messages_per_page` parameter

See original GitHub issue
  • Package Name: azure-storage-queue
  • Python Version: Python 3.7

Describe the bug When calling the function “receive_messages()”, all messages will return no matter what value I set messages_per_page

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
annatischcommented, Oct 21, 2020

Hi @evelyn-ys - The iterator does not dequeue all the messages before splitting into pages - instead, they are retrieved in batches, or “pages” at a time. So if you only wish to dequeue the first 5 messages - you would not loop the iterator to completion. For example, you could call next() like this to pull only one page at a time:

page_size = 5
page_iter = client.receive_messages(messages_per_page=page_size).by_page()

single_page = next(page_iter)
assert len(single_page) <= 5
for message in single_page:
    print(message)
0reactions
tasherif-msftcommented, Oct 28, 2020

Hi @evelyn-ys , just wanted to inform you that I have just created a PR that makes it much simpler to pop one message from the queue. Here’s the PR: #14855 This will give you the ability to retrieve one message at a time without lots of code overhead to do so 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

QueueClient.ReceiveMessages Method - Microsoft Learn
Receives one or more messages from the front of the queue. For more information, see Get Messages.
Read more >
Azure Functions: Queue Trigger is expecting Base-64 ...
Exception binding parameter 'myQueueItem' <--- The input is not a valid Base-64 string as it contains a non-base 64 character, more than two ......
Read more >
How to work with Azure Queue Storage in C# | InfoWorld
Take advantage of Azure Storage queues to store large numbers of ... but unlike Azure Service Bus, Azure Queue Storage doesn't support ...
Read more >
azure-storage-queue 12.5.0 - PyPI
Microsoft Azure Azure Queue Storage Client Library for Python. ... The credential parameter may be provided in a number of different forms, depending...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found