简体   繁体   English

服务代理对话的最佳实践:我可以打开多少个,打开多长时间?

[英]Best practices for service broker conversations: how many can I leave open and for how long?

I'm designing a system that will issue commands (via service broker) that a user may wish to undo. 我正在设计一个系统,该系统将发出用户可能希望撤消的命令(通过服务代理)。 My thinking was that I could use a pattern like this: 我的想法是我可以使用这样的模式:

  1. Create a conversation 建立对话
  2. Send the "do command" message on the newly created conversation 在新创建的对话上发送“执行命令”消息
  3. Keep the conversation open.. 保持对话畅通。
  4. If user wishes to undo, send the undo message on the conversation 如果用户希望撤消,请在对话中发送撤消消息
  5. Close conversation 结束对话

This keeps messages in order (the undo command cannot appear before the initial command it must "undo"), I recognize that this may keep many conversations open indefinitely as users for the most part will not wish to perform an undo. 这样可以使消息保持顺序(撤消命令不能在必须“撤消”的初始命令之前出现),我认识到这可能会无限期地打开许多对话,因为用户大部分都不希望执行撤消。 Would this be a performance problem? 这是性能问题吗? Is there an alternative using service broker? 是否有使用服务代理的替代方法?

You can hold them open for as long as you like, but you probably don't want them to live forever on the system. 您可以根据需要一直将它们保持打开状态,但是您可能不希望它们在系统上永远存在。 Is there a period of time after which you can reasonably infer that you are not going to get an undo? 是否有一段时间可以合理地推断出您不会撤消操作? An hour perhaps or by the end of the business day? 一个小时或在工作日结束之前?

You can give conversations a maximum lifetime so you can clear them down once you're satisfied that they are logically committed. 您可以赋予对话最长的生命周期,以便在对逻辑上的承诺感到满意后就可以将其清除。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我可以确保SQL Service Broker中对话对话的顺序吗? - Can I ensure the order of dialog conversations in sql service broker? Sql Server Service Broker:如何构建简单队列方案的对话? - Sql Server Service Broker: How to structure Conversations for a simple queue scenario? 在Service Broker上进行多次对话 - Multiple conversations on Service Broker Sql Server Service Broker中的对话 - Conversations in Sql Server Service Broker SQL Service Broker和.NET Windows服务 - 最佳实践? - SQL Service Broker and .NET Windows Service - Best practices? Service Broker:如何检测脚本在所需计算机上执行? - Service Broker: How can I detect the script is executed on the wanted machine? 如何知道我在 Windows 服务中打开了多少个 SQL 连接? - How can I tell how many SQL Connections I have open in a windows service? 如何通过队列中的许多作业来加快Service Broker的速度? - How to speed up Service Broker with many jobs on the queue? TCP套接字服务器取决于服务代理,如何接收整个消息并发送响应? - TCP socket server depending on service broker, how can I receive entire message and send response? 如何测量SQL Server Service Broker队列处理器的吞吐量? - How can I measure the throughput of SQL Server Service Broker queue processor?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM