2

Is using a handrolled POCO queue class using pseudo code

T Dequeue() {
   lock(syncRoot) { 
      if(queue.Empty) Thread.Wait(); 
   }
}

void Enqueue(T item) {
   queue.Enqueue(item);
   Thread.Notify();
}

For WCF is request queueing a scalable approach?

Nix
  • 57,072
  • 29
  • 149
  • 198
Vyas Bharghava
  • 6,372
  • 9
  • 39
  • 59

2 Answers2

1

WCF service throttling will queue requests internally without any additional code. What are you trying to do?

jezell
  • 2,532
  • 14
  • 12
  • Hi Jezell, Thanks for the reply. I just joined a new company. All their WCF services are just shims that post incoming requests to respective internal queues. And then agents are performing what is needed. I was wondering if this is the best way accomplish this. – Vyas Bharghava Oct 19 '08 at 04:08
  • 1
    If you want durable queues, netMsmqBinding is the way to go. If you don't need durable queues, WCF channel listeners will queue up incoming requests automatically based on the throttles in the configuration. – jezell Oct 20 '08 at 21:35
  • Jezell, can you direct me to a link where I can learn more about this? This sounds very interesting... – Vyas Bharghava Oct 24 '08 at 22:49
1

No it is not, because as you add more servers your solution can not scale, and is not reliable.

You should be using the built in WCF Queue Binding.

Nix
  • 57,072
  • 29
  • 149
  • 198