Here's my scenario ... I will be receiving a stream of individual messages from an outside source. The nature of this data and the processing I have to do to them is such that the more messages I can include in one batch, the more messages I can process on average. To use an example:
- Messages 1 comes in, the WCF service starts processing the message
- Messages 2 and 3 come in before step 1 is done processing. Process 2 and 3 together.
There are obviously a few assumptions here, that we can't start processing step 2 before step 1 is done, but we can process multiple messages in one run.
My initial thought was to simply use the msmq binding so that messages can queue up while one batch is processing. But then I realized that WCF will simply deliver each message one at a time. And I'm not even sure if it will wait until one message is done processing before pulling the next one and processing that one (perhaps in a thread?) which would be bad in this case.
So, I was just wondering if there might be some guidance someone could provide on how to accomplish such a system using WCF. thanks!