My suggestion, if you need to be quick about this and only need something simple to facilitate durable (disconnected) operation with WCF, is to look in to the WCF - MSMQ bindings. If you need something in a larger environment, look at nServiceBus.
In my mind, nServiceBus would really begin to shine in a larger distributed environment. Take, for instance, the following example (that would be hell on earth with WCF but simple with nServiceBus):
- Infrastructure made up of app server tier, cache server tier, read only database tier, read/write database tier
- Any time the client submits a new entry, you'd really like all of these tiers updated at once
- In WCF, you'd need to expose separate services at each tier level and have the client push to all of them (or have some central orchestration doing the same thing for you)
- In nServiceBus you'd have each tier be a subscriber to this information, and the client would publish it once, allowing the service bus to take care of the rest
WCF has MSMQ Bindings
If you need to mostly stick with WCF, however (short timelines, need other WCF features), I'd suggest you check out this articlethis article at MSDN. It shows you how to use the WCF bindings for MSMQ, and then shows you how to migrate one service from HTTP to MSMQ. Along the way it shows you some of the problems with this scenario (and useful solutions to these problems).
Both of these suggestions make heavy use of MSMQ, so a note about that: unlike Apache MQ, RabbitMQ, and other popular queueing systems, MSMQ is not a typical broker based queue architecture, it is instead a distributed queue. This means that if your WCF client sends a message over an MSMQ transport while it cannot connect to the remote server that hosts the queue, the client machine will enqueue the message in what is referred to as an "Outgoing Queue" locally instead. The message will stay there safely until such time as the client's MSMQ service detects that it can connect to the remote MSMQ service again. At that point the message will flow from the client to the end destination.
There is at least one caveat to the above - if the remote server is offline for too long (check your documentation for MSMQ) the client will give up and move the message from outgoing to the dead letter queue. Messages transferred to the dead letter queue cannot be re-sent automatically, they must be re-constructed.
If you require encryption and don't have ActiveDirectory, on this blog entry, Sergey Sorokin details the steps necessary to encrypt communication of MSMQ using WCF without Active Directory.