Ayende @ Rahien

My name is Oren Eini
Founder of Hibernating Rhinos LTD and RavenDB.
You can reach me by phone or email:


+972 52-548-6969

, @ Q c

Posts: 10 | Comments: 37

filter by tags archive

Batching WCF Calls

time to read 1 min | 156 words

Several months ago I wrote about how I think you should design your services. The key criteria was that they have to have a batch mode enabled.

Afterward, I put together a screen cast that goes through all the stages that led me to that stage.

Davy Brion has taken this approach a bit further and posted all the infrastructure bits that are required to make this work as well as what you need to actually make the API almost as nice to use as the non batched version.

The service API is here and the client API is here.

About the only thing that I would strive to improve there would be the need to explicitly register request & replies. I would try to get something convention based there. Maybe something like Request<TRespose>, and then have IHandler<TRequest> and route the whole thing through the container again.


Davy Brion

yea i'm not happy with the explicit registering either... i really want something better there so i'll look into your suggestion ;)


I like the way it is done in NServiceBus - all you need is three interfaces (IMessage, IHandler, IBus). Just substitute the IBus for your IService and your done. Why bother to add specific service interfaces like IProductsService?

The interface IHandler has another advantage - one class can implement many of these, so you can have e.g. all product messages handling code in one class (you don't need one class per message anymore).

Davy Brion

the specific service interfaces are there in case you prefer to just call one specific method... it's also good for 'discoverability'

i actually like to have one class per message. depending on how many messages you have regarding products, it could be a huge class if you handled all of them in the same class. Also, one class per message makes it really easy to have the container inject each dependency you need

Davy Brion

ok, now you no longer need to explicitly register Requests & Replies

you can find the new implementation here:


Comment preview

Comments have been closed on this topic.


  1. Production postmortem: The case of the memory eater and high load - one day from now
  2. Production postmortem: The case of the lying configuration file - about one day from now
  3. Production postmortem: The industry at large - 3 days from now
  4. The insidious cost of allocations - 4 days from now
  5. Find the bug: The concurrent memory buster - 5 days from now

And 4 more posts are pending...

There are posts all the way to Sep 10, 2015


  1. Find the bug (5):
    20 Apr 2011 - Why do I get a Null Reference Exception?
  2. Production postmortem (10):
    14 Aug 2015 - The case of the man in the middle
  3. What is new in RavenDB 3.5 (7):
    12 Aug 2015 - Monitoring support
  4. Career planning (6):
    24 Jul 2015 - The immortal choices aren't
View all series


Main feed Feed Stats
Comments feed   Comments Feed Stats