简体   繁体   English

在Sql Service Broker中,是否可以使用特定的session_handle创建对话框

[英]In Sql Service Broker, is it possible to create a dialog with specific conversation_handle

I'm using Service Broker as a messaging queue for a job engine. 我正在使用Service Broker作为作业引擎的消息队列。 When the jobs are created they are given a Guid that is used by the system to track the progress of a job. 创建作业后,会为他们提供一个Guid,系统会使用该Guid来跟踪作业的进度。 Given that, would it be possible to create a dialog in Service Broker that uses a given Guid instead of creating it's own? 鉴于此,是否有可能在Service Broker中创建一个对话框,该对话框使用给定的Guid而不是创建它自己的Guid?

You can specifiy a RELATED_CONVERSATION_GROUP (a GUID) when you do BEGIN DIALOG . 进行BEGIN DIALOG时,可以指定RELATED_CONVERSATION_GROUP (GUID)。 A conversation group is just made up and tracked by your application, and you can receive messages for that conversation group or see what conversation group a received message belongs to. 会话组只是由您的应用程序组成并跟踪的,您可以接收该会话组的消息或查看接收到的消息属于哪个会话组。

不,为您创建了session_handles,您无法指定它们。

As @RBarryYoung says, no, you cannot. 正如@RBarryYoung所说,不,你不能。

Could you turn the question on it's head? 你能把这个问题摆在头上吗? Could you delay needing a job Guid until you start a dialog, and then use the returned conversation handle as the job Guid? 您是否可以延迟需要工作Guid直到启动对话框,然后将返回的对话句柄用作工作Guid?

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM