stephen
stephen

Reputation: 385

How to long poll the Azure service bus topic/subscription

I cannot find clarification whether or not it's possible to use the long poll option with the topic/subscription model. It is possible with service bus queues but I'd have to create thousands of separate queues to enable each client to receive their own messages. So is it possible and if so can you point me toward an implementation example?

Thanks.

Upvotes: 0

Views: 672

Answers (1)

stephen
stephen

Reputation: 385

Actually I think just found the answer. In case anyone else is stuck the syntax is:

`serviceBusClient.receiveSubscriptionMessage(topicListener, subscriber, 
{timeoutIntervalInS: 120 },
        function (error, message) {...});`

for 120 seconds but, you know, don't hard code magic numbers. This is limited to 230 seconds due to azure returning an error for http requests that receive no data in this period of time. If anyone knows a way to extend this timeout I'd appreciate the insight.

Upvotes: 1

Related Questions