首页 / 软件开发 / WCF / WCF服务编程设计规范(6):队列服务、安全和服务总线
WCF服务编程设计规范(6):队列服务、安全和服务总线2012-02-23 博客园 Frank Xu LeiWCF服务编程设计规范(6):队列服务、安全和服务总线。本节整理队列服务(Queue Servuce)、服务安全(Service Security)和服务总线(Service Bus)的设计规范。Queued Services队列服务1. On the client, always verify that the queue (and a dead-letter queue, when applicable) is available before calling the queued service. Use QueuedServiceHelper.VerifyQueues() for this purpose.在客户端,在调用队列服务以前,始终检查队列是否可用(如果可以的话,也包括确认死信队列)。使用QueuedServiceHelper.VerifyQueues()方法检查。2. Always verify that the queue is available when hosting a queued service (this is done automatically by ServiceHost<T>).当托管队列服务的时候始终检查队列是否可用(ServiceHost<T>会自动检测)3. Except in isolated scenarios, avoid designing the same service to work both queued and non-queued.除了某些单独的场景,避免避免在同一个服务里同时使用队列和非队列服务4. The service should participate in the playback transaction.服务应该参与到回放事务中5. When participating in the playback transaction, avoid lengthy processing in the queued service.当参与到回放事务里,避免队列服务里出现冗长的处理工作6. Avoid sessionful queued services.避免使用会话性队列服务7. When using a singleton queued service, use a volatile resource manager to manage the singleton state.当使用单例队列服务时,使用易失资源管理器去管理单例状态