Skip to Main Content
Programming WCF Services
book

Programming WCF Services

by Juval Lowy
February 2007
Intermediate to advanced content levelIntermediate to advanced
634 pages
16h 1m
English
O'Reilly Media, Inc.
Content preview from Programming WCF Services

Queued Services

  1. 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.

  2. Always verify that the queue is available when hosting a queued service (done automatically by ServiceHost<T>).

  3. Except in isolated scenarios, avoid designing the same service to work both queued and nonqueued.

  4. Do enable metadata exchange on a queued service.

  5. The service should participate in the playback transaction.

  6. When participating in the playback transaction, avoid lengthy processing in the queued service.

  7. Avoid sessionful queued services.

  8. When using a singleton queued service, use a volatile resource manager to manage the singleton state.

  9. 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
    {...}
  10. Always explicitly set contracts on a queued singleton to disallow sessions:

    [ServiceContract(SessionMode = SessionMode.NotAllowed)]
    interface IMyContract
    {...}
    
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
    class MyService : IMyContract
    {...}
  11. The client should call a queued service inside a transaction.

  12. On the client side, do not store a queued service proxy in a member variable.

  13. 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.
Start your free trial

You might also like

Programming WCF Services, 3rd Edition

Programming WCF Services, 3rd Edition

Juval Lowy
Mastering ASP.NET Web API

Mastering ASP.NET Web API

Mithun Pattankar, Malendra Hurbuns

Publisher Resources

ISBN: 0596526997Supplemental ContentErrata Page