Hi,
Imagine the following setup: a Silverlight client tunnels a serialized command over the network using a WCF service which in turn deserializes the command and sends it using NServiceBus to a generic host which is responsible for processing the command. The WCF service has - upon sending the command - registered a callback to be invoked. The generic host validates the command and 'returns' an error code (either 0 == success or >0 == failure).
Note: The WCF service is modelled after the built-in WCF service. The difference is that this WCF service receives a 'universal command' (not an IMessage), deserializes it into a real command (which does implement IMessage), and consequently sends the deserialized command off to the bus.
When unexpected exceptions occur, the command gets (after a certain amount of retries) queued in an error queue. At this point, the initiating WCF service sits there idle, unaware of what just happened. At some later point, the Silverlight client will time out according to the WCF client proxy configuration.
Things which are fuzzy in my head:
- Does NServiceBus handle this scenario in any way? When does the timeout exception get thrown (if at all)? Or is this something exclusive to sagas?
- Presuming I use [OperationContract(AsyncPattern=true)], are there any WCF related timeout settings that will kill the service operation? Or will the EndXXX method be somehow called? Or will it sit there forever, leaking, waiting for something that will never come?
Ways to proceed:
- reuse existing timeout mechanisms, provided things don't leak.
- build my own timeout mechanism between the wcf service and nservicebus.
- notify the wcf service somehow when the command lands in the error queue.
- build my own async notifcation mechanism using full blown callback message handler in the WCF service layer.
Things I've done:
- run the example provided with NServiceBus.
- spiked the happy case.
Any guidance on how to proceed is welcome, be it blog post, mailing list entries, ...
Some motivations for picking my current approach
- I'm trying to leverage some of the scalability advantages (using distributor in a later phase) of NServiceBus.
- I don't want to host a gazillion WCF services (one for each command), that's why I cooked up a bus-like WCF service.
- Even though this is somewhat request/response style, I'm mostly concerned with gracefully handling a command reply not coming through.