-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
[ServiceBus][7.0.0][Bug] get_queue_receiver will lock 1 message #15555
Comments
Add another question
|
hey @DzcleisureCN , thanks for reaching out. I'm investigating the lock 1 message issue. to your third point:
are you saying that you want to receive message from one receiver but complete the message using another receiver? sorry we should make it more clear, we would add some notes or make it raise error in a big fix release. It is not suggested for now to settle messages using a receiver different than the one which receives the message as the settlement actually happens on the specific amqp receiver link. And I will bring this to the team to see how we could ultimately achieve your goal. re: another question:
Please check the exception part in our readme for more information. |
Hi Yunhaoling,
if the receiver is inactive for 10 mins, the service would proactively send a request telling the client to shut down the connection. Why I ask this is because we find get a receiver usually cost some time, so we want to keep receiver to re-used, but if the receiver closed by the server we need a way to know that and to re-open a new receiver.
Thanks |
hey @DzcleisureCN , in general you would need to do the latter -- catch the exception TL,DR: you could reuse the receiver as long as the receiver is not explicitly closed, the sdk could try to reconnect to the service.
# some initialization code
work_flag = True
with servicebus_receiver:
while work_flag:
try:
receiver.receive_messages(max_message_count=10)
exception ServiceBusConnectionError, ServiceBusError:
# if the sdk has encountered a connection error leading to the connection closed, an error would bubble up
# but the program execution is still in the context manager block -- with servicebus_receiver:
# so you could choose to ignore the connection error, and in next service request call the sdk tries to reestablish the connection.
log.info('error occurred')
continue
# exiting the with block will close the servicebus_receiver, and it can no longer be used
servicebus_receiver.receive_messages(max_message_count=10) # this call would raise value error We also have some sample codes on failure and recovery, you could check it here: Let me know if this answers your question. |
Hi @yunhaoling Thanks for your help and I had verified your PR, now close the Issue. |
hey @DzcleisureCN , are you referring to the PR #15622? it's still under construction, I need to do more test to convince myself that it is a solid fix😋 |
hi @yunhaoling |
azure-servicebus
7.0.0
Centos
3.7
Describe the bug
get_queue_receiver will lock 1 message in the queue.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Also can get 5 messages.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: