azure-sdk-for-js: [Service Bus] Long-running Streaming Listener stops receiving/de-queuing messages after a while

I have a listener that follows this pattern: https://github.com/Azure/azure-sdk-for-js/blob/master/packages/%40azure/servicebus/data-plane/examples/javascript/gettingStarted/receiveMessagesStreaming.js

The receiver.receive() call happens in my app at startup, and it works… but after a period of time (or maybe a period of idle time… not sure which), the connection to servicebus doesn’t work anymore and messages are stuck in the bus and not de-queued. These are the console messages when that happens:

image

I can’t find any tutorials or documents illustrating a different receiving paradigm that either 1) polls Sbus or 2) keeps the connection alive and working regardless of up-time, so I’m inclined think this is a bug in the receive() behavior.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 2
  • Comments: 21 (9 by maintainers)

Most upvoted comments

@bdelville,

In my case it fails without throwing an error Just wondering in such case, do we have access a status so the client can have the knowledge that it won’t received any message? This one return false: receiver.isClosed

You can try the isReceivingMessages property on the receiver.

@Burnett2k, @bdelville,

We have just released an update (1.1.1) to the @azure/service-bus package which has the fix to the issue of the library never calling the user’s error handler if it fails all its retry attempts to recover broken receivers. After upgrading to this version your error handler should be called when there is a problem with the receiver.

@ramya-rao-a We are also seeing this behavior. We specifically have seen this using the 1.0.0-preview.2 version and now on the 1.0.2 version. This issue is present for createReceiver on both a subscriptionClient and queueClient. As @agates said, I have also been unable to find any relevant log messages, partially due to not knowing when the issue even begins. I have noticed some receivers able to run for days without issue yet others stop their processing after only one day. Please let me know if there is anything else that I can do to help the research of this issue or if there is any further information that I may be able to provide.