none
ServiceBus queues/topics flow control RRS feed

  • Question

  • Hi,

    I want to use the ServiceBus queues/topics to control the flow of messages.

    What I need is to do is to send messages to queues and I want these messages to be consumed by applications but I want to control the flow. For example, if I have 100 messages in the queue, I don't want the consumer to be able to receive more than 10 messages per seconds for example.

    Is it possible with Service Bus?

    Thanks.

    Tuesday, May 3, 2016 9:32 AM

Answers

  • Hi David,

    There is no such feature on Service Bus today. You need to implement flow control on the client side. Basically you can keep track of a rate counter on each receiver client and throttle when needed. Let me know if you have any other questions regarding the topic.

    Tuesday, May 3, 2016 7:22 PM

All replies

  • Hi David,

    There is no such feature on Service Bus today. You need to implement flow control on the client side. Basically you can keep track of a rate counter on each receiver client and throttle when needed. Let me know if you have any other questions regarding the topic.

    Tuesday, May 3, 2016 7:22 PM
  • Hi Serkant,

    What about the PrefetchCount property of the MessagingFactory class? Is it a good way to avoid receiving too much messages at a time and then automatically control the flow rate (on the client side)?

    Thanks.

    Tuesday, May 3, 2016 7:39 PM
  • PrefetchCount setting helps to increase the throughput. It won't provide a good control on throttling.

    Try this: Disable prefetch-count and then do sequential receives on a single client. See how many messages are typically flowing per second on average. I think this way you can slow down the receives.

    Tuesday, May 3, 2016 7:47 PM
  • Ok but the consumer will probably be BizTalk, so I'm not sure I will have this feature available.

    Tuesday, May 3, 2016 7:51 PM
  • Ok I see. Btw, why do you need to slow down the receives?
    Tuesday, May 3, 2016 8:33 PM
  • We need to slow down the process because it calls back-end services / systems and these systems are not able to absorb the load. So if we do not slow down, those systems will fail and this will cause major outage on those systems that are used by end-users.
    Tuesday, May 3, 2016 8:38 PM
  • Fair enough I believe. Unfortunately, I am not a BizTalk expert. I wonder if you can control number of parallel processes on the server itself. This one seems to be a good candidate, can you check? https://msdn.microsoft.com/en-us/library/aa577604.aspx?f=255&MSPPError=-2147217396
    Tuesday, May 3, 2016 8:45 PM