Each participant is responsible for explicitly ending the conversation when the application receives a message that indicates an error or the end of the conversation 每个参与者均有责任在应用程序收到指示错误的消息或结束会话的消息时显式结束会话。
You can write a simple procedure that receives each message on the queue , ends the conversation with an error , and removes the state for the conversation 您可以编写一个简单的过程,它接收队列中的每个消息,结束会话同时返回一个错误,然后删除该会话的状态。
Therefore , if the application maintains state , you must be careful to remove the state associated with the conversation after ending the conversation with an error 因此,如果该应用程序维护状态,则您必须在结束会话并返回错误后,小心地删除与该会话关联的状态。
Processing all the messages in the queue allows the target applications to end the conversation gracefully rather than wait for a response from the service you are shutting down 处理队列中的所有消息可以使目标应用程序正常地结束会话,而不必等待来自您要关闭的服务的响应。
Whichever method you choose , ending the conversations allows the initiating applications to end gracefully rather than waiting for a response from the service you are shutting down 无论选择哪一种方法,结束会话可使起始应用程序正常结束,而不必等待来自您要关闭的服务的响应。
You can let the application process the messages , write a simple procedure that ends the conversations with an application - specific error , or simply drop the service to end the conversations with a service broker error 您可以让应用程序处理消息,或者编写一个以应用程序特定错误结束会话的简单过程,还可以仅删除该服务以便以service broker错误结束会话。
Sessions can be initiated or ended to modify their state , but they generally remain in either a " sleep " state , such as when the session has been initiated and is open at the server for client use ; or a " dormant " state , such as when the session has been ended and the session is not currently available at the server for client use 可以启动或结束会话来修改它们的状态,但它们通常保留为“睡眠”状态(如会话已启动且在服务器上处于打开状态以供客户端使用时)或“休眠”状态(如会话已结束且当前在服务器上无法用于客户端时) 。