I have a fairly straightforward scatter-gather pattern implemented using an IIS-hosted web service (WCF) as both the request handler (broadcast) and aggregator.
Everything runs pretty smoothly using the standard NetMsmqBinding
, one-way message contracts, and WAS. But now we want to introduce a business rule, whereby the aggregator will only wait a certain amount of time (probably a few days) for the final responses; if some or all of them are not received, it should close out the batch and publish whatever information it has. Normally it would only initiate a publish when all endpoints have reported.
I know that I can set message expirations on the broadcast messages so that the endpoints don't waste time doing unnecessary work, but what about triggering the early publish?
NServiceBus treats sagas as a first-class citizen, handling timeouts gracefully, and I know that BizTalk actually implements the entire scatter-gather as a single orchestration. But I don't want to have to deploy any new tools or services just for this one requirement.
Is there a way to implement a long-running batch timeout action using just WCF and MSMQ?
(Again - the aggregator is hosted in IIS, so I can't just set a timer; the app pool could be recycled or shut down at any time.)