You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/database-engine/service-broker/broker-system-messages.md
+7-28Lines changed: 7 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,16 +18,12 @@ Service Broker uses three system message types to communicate status and error i
18
18
19
19
## Handling System Messages
20
20
21
-
22
-
23
21
Most of the messages in a Service Broker conversation are the application-defined messages used to communicate between services. Each message must comply with a message type format that was defined by a CREATE MESSAGE TYPE statement. The set of message types allowed for a conversation is defined by the contract specified in the BEGIN DIALOG CONVERSATION statement.
24
22
25
23
In addition to the application-defined message types specified in the contract, any conversation can also receive messages that use one of three system-defined message types. These message types are used by Service Broker to report errors and the status of dialogs. Every application must contain logic to handle Error messages and End Dialog messages. If the application sets a conversation timer on a dialog conversation, the application must contain logic to handle Dialog Timer messages. Service Broker provides these message types to every service, whether they appear in the contract for the service or not. For more information, see [Handling Service Broker Error Messages](handling-service-broker-error-messages.md).
26
24
27
25
## Error Messages
28
26
29
-
30
-
31
27
When a remote service ends a dialog with an error or the local broker detects an unrecoverable error in a dialog, the local broker creates an Error Message. Error messages are of message type **https://schemas.microsoft.com/SQL/ServiceBroker/Error**. Error messages are validated as well-formed XML.
32
28
33
29
The XML document that is contained in an error message uses the namespace **https://schemas.microsoft.com/SQL/ServiceBroker**. The root element of the document has the local name **Error**, and contains an element named **Code** and an element named **Message**. The **Code** element holds an integer value. The **Message** element holds the human-readable text of the message.
@@ -51,39 +47,22 @@ When an error message arrives for a dialog, the broker raises an error if an app
51
47
52
48
## End Dialog Messages
53
49
54
-
55
-
56
50
When an application ends a dialog without specifying an error, the local broker sends an End Dialog message to the remote broker. End Dialog messages are of message type **https://schemas.microsoft.com/SQL/ServiceBroker/EndDialog**.
57
51
58
52
End Dialog messages are empty messages. A receive operation receives an End Dialog message in the order in which the message arrived on the queue.
59
53
60
54
## Dialog Timer Messages
61
55
62
-
63
-
64
56
Dialog timer messages indicate that the conversation timer on a dialog has expired. These messages are of message type **https://schemas.microsoft.com/SQL/ServiceBroker/DialogTimer**. A conversation timer is specific to one side of the conversation; Service Broker never sends a dialog timer message to the other side of the conversation.
65
57
66
58
Dialog timer messages are empty messages. A receive operation receives the dialog timer message before any other message for that dialog, regardless of the order in which the time-out message arrived on the queue.
67
59
68
60
## See Also
69
61
70
-
71
-
72
-
#### Tasks
73
-
74
-
[How to: Retrieve Information from a Service Broker Error Message (Transact SQL)](how-to-retrieve-information-from-a-service-broker-error-message-transact-sql.md)
-[How to: Retrieve Information from a Service Broker Error Message (Transact SQL)](how-to-retrieve-information-from-a-service-broker-error-message-transact-sql.md)
Copy file name to clipboardExpand all lines: docs/database-engine/service-broker/creating-a-remote-service-binding.md
+2-11Lines changed: 2 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,11 +21,8 @@ When a conversation is initiated, Service Broker checks to see whether a remote
21
21
> [!NOTE]
22
22
> The behavior is comparable to [Service Broker Dynamic Routing](service-broker-dynamic-routing.md).
23
23
24
-
25
24
## Requesting Remote Service Binding
26
25
27
-
28
-
29
26
Requests for remote service bindings use the message type **https://schemas.microsoft.com/SQL/ServiceBroker/BrokerConfigurationNotice/MissingRemoteServiceBinding**. The message is in XML format, and contains the name of the service for which remote service binding information should be available.
30
27
31
28
For example, the following message is a request for a remote service binding to the service **http://Adventure-Works.com/Elsewhere**:
@@ -44,11 +41,5 @@ In either case, the application ends the conversation. Service Broker sends one
44
41
45
42
## See Also
46
43
47
-
### Reference
48
-
49
-
[CREATE REMOTE SERVICE BINDING (Transact-SQL)](../../t-sql/statements/create-remote-service-binding-transact-sql.md)
Copy file name to clipboardExpand all lines: docs/database-engine/service-broker/creating-service-broker-message-types.md
+2-12Lines changed: 2 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,16 +22,12 @@ The Service Broker communications protocols are designed to work with this messa
22
22
23
23
## Choosing a Validation Type
24
24
25
-
26
-
27
25
The validation specified for the message depends on the content of the message. A common practice is to use the most restrictive validation available during testing, and then to choose less-restrictive validation to improve performance when the application is deployed. For example, it is possible to exchange a typed XML document as the body of a message that specifies a validation of NONE. In this case, your application validates the message when processing the XML.
28
26
29
27
The network format for a message includes the name of the message type. Therefore, message type names are often chosen to avoid collation issues and naming conflicts. For more information on naming, see [Naming Service Broker Objects](naming-service-broker-objects.md).
30
28
31
29
## Indicating Success and Failure
32
30
33
-
34
-
35
31
An application typically does not define new message types to indicate success or failure. Instead, use the END CONVERSATION statement to indicate that the conversation is complete and that the task succeeded. If the task failed, include the WITH ERROR option to return an error message on the conversation.
36
32
37
33
In general, only one of the participants in the conversation should end the conversation when the task is complete. The other participant only issues an END CONVERSATION in response to an End Dialog or Error message. The documentation for a service generally specifies which participant ends the conversation if the conversation completes successfully. Providing this documentation helps to avoid problems where neither participant ends the conversation, or where one participant ends the conversation while the other participant is still performing tasks. Both endpoints must be able to process error messages because internal Service Broker messages are delivered to both endpoints. For example, if the dialog lifetime expires before the dialog is closed, both endpoints receive a Service Broker error message.
@@ -40,11 +36,5 @@ Either participant can end a conversation with an error at any time. For a discu
40
36
41
37
## See Also
42
38
43
-
### Reference
44
-
45
-
[CREATE MESSAGE TYPE (Transact-SQL)](../../t-sql/statements/create-message-type-transact-sql.md)
46
-
47
-
### Concepts
48
-
49
-
[Service Broker Communication Protocols](service-broker-communication-protocols.md)
50
-
39
+
-[CREATE MESSAGE TYPE (Transact-SQL)](../../t-sql/statements/create-message-type-transact-sql.md)
40
+
-[Service Broker Communication Protocols](service-broker-communication-protocols.md)
Copy file name to clipboardExpand all lines: docs/database-engine/service-broker/developer-responsibilities-for-service-broker.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,23 +18,23 @@ The application developer is responsible for designing the Service Broker applic
18
18
19
19
The tasks involved in creating an individual application depend on the needs of the application. The following is a common sequence of tasks for developing a Service Broker application:
20
20
21
-
1.Plan the application. Create an outline of the tasks that the application must accomplish. Describe the conversations that take place during each task. Which endpoint needs to provide what information, in what order? What processing must take place? What priorities should be assigned to the conversations? All subsequent information depends on this outline.
21
+
1. Plan the application. Create an outline of the tasks that the application must accomplish. Describe the conversations that take place during each task. Which endpoint needs to provide what information, in what order? What processing must take place? What priorities should be assigned to the conversations? All subsequent information depends on this outline.
22
22
23
-
2.Determine the format and structure of each message in each conversation. Plan the expected sequence of exchange for the messages, and how each participant in the conversation should respond to errors and messages that are sent in an unexpected order.
23
+
2. Determine the format and structure of each message in each conversation. Plan the expected sequence of exchange for the messages, and how each participant in the conversation should respond to errors and messages that are sent in an unexpected order.
24
24
25
-
3.If the conversation uses XML messages, create a schema for each XML message. You use schemas during development, testing, and troubleshooting. When your service is in production, you may decide to remove schema validation from your message types, to improve performance.
25
+
3. If the conversation uses XML messages, create a schema for each XML message. You use schemas during development, testing, and troubleshooting. When your service is in production, you may decide to remove schema validation from your message types, to improve performance.
26
26
27
-
4.Create a message type for each message in each conversation.
27
+
4. Create a message type for each message in each conversation.
28
28
29
-
5.Create a contract for each conversation. The contract identifies the message types that can be used by each endpoint in the conversation.
29
+
5. Create a contract for each conversation. The contract identifies the message types that can be used by each endpoint in the conversation.
30
30
31
-
6.Create a queue to store the messages that will be received by the application.
31
+
6. Create a queue to store the messages that will be received by the application.
32
32
33
-
7.Create a service to expose the functionality defined by the contract, and implemented by the stored procedure, that you created. When creating a service, you associate it with the queue you created in the previous step. By doing this, you tell Service Broker that all messages that arrive addressed to that service are to be placed in the identified queue.
33
+
7. Create a service to expose the functionality defined by the contract, and implemented by the stored procedure, that you created. When creating a service, you associate it with the queue you created in the previous step. By doing this, you tell Service Broker that all messages that arrive addressed to that service are to be placed in the identified queue.
34
34
35
-
8.Review the priority plans that you established in step 1. Create conversation priorities that cover all conversation endpoints that are designed to use priority levels other than the default. If the priority levels should be used when messages are transmitted from a database, ensure that the HONOR_BROKER_PRIORITY option in that database is set to ON.
35
+
8. Review the priority plans that you established in step 1. Create conversation priorities that cover all conversation endpoints that are designed to use priority levels other than the default. If the priority levels should be used when messages are transmitted from a database, ensure that the HONOR_BROKER_PRIORITY option in that database is set to ON.
36
36
37
-
9.Create an application that implements the expected message exchange pattern and processing requirements identified in step 1. If your application uses internal activation, the application is a stored procedure.
37
+
9. Create an application that implements the expected message exchange pattern and processing requirements identified in step 1. If your application uses internal activation, the application is a stored procedure.
38
38
39
39
10. If your application uses internal activation, alter the queue to enable activation. Specify the stored procedure created in step 8 as the activation stored procedure.
40
40
@@ -46,4 +46,4 @@ The tasks involved in creating an individual application depend on the needs of
46
46
47
47
## See Also
48
48
49
-
[Planning for Service Broker Development](planning-for-service-broker-development.md)
49
+
-[Planning for Service Broker Development](planning-for-service-broker-development.md)
Copy file name to clipboardExpand all lines: docs/database-engine/service-broker/handling-service-broker-error-messages.md
+5-18Lines changed: 5 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,8 +18,6 @@ Service Broker applications must handle two types of error messages received fro
18
18
19
19
## Reporting Application Error Conditions
20
20
21
-
22
-
23
21
Service Broker applications are typically systems that consist of code running asynchronously on different computers. The parts of the application communicate with each other by using messages sent on Service Broker conversations. The part of the application on one side of a Service Broker conversation can report application errors to the other side by sending error messages. The receiving part of the application must have code to detect an error message and correctly handle the error condition.
24
22
25
23
Service Broker applications can communicate errors by using either system-defined or application-defined message types.
@@ -61,8 +59,6 @@ The remote part of the application that receives the error message must have cod
61
59
62
60
## Handling Error Messages
63
61
64
-
65
-
66
62
Application code receiving messages from Service Broker conversations must have logic to process error messages received from the conversation. The code must detect and handle the following:
67
63
68
64
- Error messages generated by an application that uses an application-defined error message type.
@@ -83,17 +79,8 @@ Error handling routines should be coded in such a way as to prevent poison messa
Copy file name to clipboardExpand all lines: docs/database-engine/service-broker/how-to-configure-target-services-for-anonymous-dialog-security-transact-sql.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ SQL Server uses dialog security for any conversation to a service for which a re
41
41
[!INCLUDE [SQL Server Service Broker AdventureWorks2008R2](../../includes/service-broker-adventureworks-2008-r2.md)]
0 commit comments