Queued Services
Always verify that the queue (and a dead-letter queue when applicable) is available before calling the queued service. Use
QueuedServiceHelper.VerifyQueue<T>( )to verify.Always verify that the queue is available when hosting a queued service (done automatically by
ServiceHost<T>).Except in isolated scenarios, avoid designing the same service to work both queued and nonqueued.
Do enable metadata exchange on a queued service.
The service should participate in the playback transaction.
When participating in the playback transaction, avoid lengthy processing in the queued service.
Avoid sessionful queued services.
When using a singleton queued service, use a volatile resource manager to manage the singleton state.
When using a per-call queued service, do explicitly configure the contract and the service to be per-call and sessionless:
[ServiceContract(SessionMode = SessionMode.
NotAllowed)] interface IMyContract {...} [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)] class MyService : IMyContract {...}Always explicitly set contracts on a queued singleton to disallow sessions:
[ServiceContract(SessionMode = SessionMode.
NotAllowed)] interface IMyContract {...} [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)] class MyService : IMyContract {...}The client should call a queued service inside a transaction.
On the client side, do not store a queued service proxy in a member variable.
Avoid relatively short values of
TimeToLive, as they negate ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access