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
description: "This section describes the tasks that are involved in administering a database that hosts a Service Broker application."
4
4
author: rwestMSFT
5
5
ms.author: randolphwest
6
6
ms.reviewer: mikeray, maghan
7
-
ms.date: "03/30/2022"
7
+
ms.date: 08/29/2025
8
8
ms.service: sql
9
9
ms.subservice: configuration
10
10
ms.topic: reference
@@ -16,26 +16,17 @@ ms.topic: reference
16
16
17
17
This section describes the tasks that are involved in administering a database that hosts a Service Broker application. Most administrative tasks are part of the regular administration for the database. This section describes how to install and manage applications, establish Service Broker identities, and monitor and troubleshoot the queues. It also describes performance and security issues.
18
18
19
-
## In This Section
19
+
## In this section
20
20
21
-
-[Managing Service Broker Applications](managing-service-broker-applications.md)
22
-
Describes the tasks that are required to install, maintain, and uninstall Service Broker applications.
21
+
| Article | Description |
22
+
| --- | --- |
23
+
|[Managing Service Broker Applications](managing-service-broker-applications.md)| Describes the tasks that are required to install, maintain, and uninstall Service Broker applications. |
24
+
|[Managing Service Broker Identities](managing-service-broker-identities.md)| Describes how Service Broker identities protect against message misdirection. |
25
+
|[Managing Queues and Messages](managing-queues-and-messages.md)| Describes how an administrator works with queues and messages. |
26
+
|[Managing Forwarding (Service Broker)](managing-forwarding.md)| Describes administrative considerations to manage a database that provides Service Broker message forwarding. |
27
+
|[Managing Security (Service Broker)](managing-security.md)| Describes administrative considerations to manage the security for a Service Broker application. |
28
+
|[Managing Routing](managing-routing.md)| Describes considerations to manage routing. |
23
29
24
-
-[Managing Service Broker Identities](managing-service-broker-identities.md)
25
-
Describes how Service Broker identities protect against message misdirection.
26
-
27
-
-[Managing Queues and Messages](managing-queues-and-messages.md)
28
-
Describes how an administrator works with queues and messages.
Backup and restore procedures for a Service Broker service are integrated with the database in which the service runs. If the service contains components outside the database, such as an external application, you must back up and restore those components separately.
17
+
Backup and restore procedures for a Service Broker service are integrated with the database in which the service runs. If the service contains components outside the database such as an external application, you must back up and restore those components separately.
18
18
19
-
The **msdb** database contains routes for incoming messages. Therefore, these routes are not backed up with the database that contains the service. Service Broker endpoints and configuration for transport security are stored in the **master** database, so these objects also are not backed up with the database that contains the service.
19
+
The `msdb` database contains routes for incoming messages. Therefore, these routes aren't backed up with the database that contains the service. Service Broker endpoints and configuration for transport security are stored in the `master` database, so these objects also aren't backed up with the database that contains the service.
20
20
21
-
Service Broker routing relies on a unique identifier in each database to correctly deliver messages. When restoring a backup that is intended to replace the original database, ensure that this identifier is not changed. When restoring a copy of a database to a different location, take care to change this identifier. For more information on Service Broker database identities, see [Managing Service Broker Identities](managing-service-broker-identities.md).
21
+
Service Broker routing relies on a unique identifier in each database to correctly deliver messages. When restoring a backup that is intended to replace the original database, ensure that this identifier isn't changed. When restoring a copy of a database to a different location, take care to change this identifier. For more information on Service Broker database identities, see [Managing Service Broker Identities](managing-service-broker-identities.md).
22
22
23
-
## See also
23
+
## Related content
24
24
25
25
-[Migration (Service Broker)](migration.md)
26
-
-[Back Up and Restore of SQL Server Databases](../../relational-databases/backup-restore/back-up-and-restore-of-sql-server-databases.md)
26
+
-[Back up and restore of SQL Server databases](../../relational-databases/backup-restore/back-up-and-restore-of-sql-server-databases.md)
Queuing and asynchronous messaging are needed for many database applications today. Service Broker provides a new, queue-based durable messaging framework to address these needs. Using the Transact-SQL API provided by Service Broker, you can easily develop services to handle application requirements for queuing or asynchronous communications.
17
+
Queuing and asynchronous messaging are needed for many database applications today. Service Broker provides a queue-based durable messaging framework to address these needs. Using the Transact-SQL API provided by Service Broker, you can easily develop services to handle application requirements for queuing or asynchronous communications.
18
18
19
19
Some of the benefits of programming with Service Broker are:
20
20
21
-
-**Flexible development:**The programs used in a single distributed application can be written in multiple languages. Each program provides the functionality of each distributed application component.
21
+
-**Flexible development:**You can write the programs used in a single distributed application in multiple languages. Each program provides the functionality of each distributed application component.
22
22
23
-
-**Improved security:** You can express security requirements via certificates, so application components do not need to share the same security context. Service Broker uses SQL Server security features to help you secure your applications.
23
+
-**Improved security:** You can express security requirements via certificates, so application components don't need to share the same security context. Service Broker uses SQL Server security features to help you secure your applications.
24
24
25
25
-**Transactional processing:** Message processing occurs within SQL Server transactions to ensure data integrity. Service Broker supports remote transactional messaging over a standard connection to the database.
26
26
27
-
-**Guaranteed ordering:** Service Broker provides strong guarantees regarding the delivery and processing of a related set of messages exactly once and in order, so no additional coding is required to provide this functionality.
27
+
-**Guaranteed ordering:** Service Broker provides strong guarantees regarding the delivery and processing of a related set of messages exactly once and in order, so there's no additional coding required to provide this functionality.
28
28
29
-
-**Reliable delivery:** All of the data needed for a conversation--a set of related communications between two or more services--is persisted in SQL Server. Service Broker supports clustering and database mirroring. A conversation may be maintained through system restarts, server failover, network outages, and so on without failing or losing data.
29
+
-**Reliable delivery:** All of the data needed for a conversation, or a set of related communications between two or more services, is persisted in SQL Server. Service Broker supports clustering and database mirroring. A conversation can be maintained through system restarts, server failover, network outages, and so on without failing or losing data.
30
30
31
31
-**Improved scalability:** Service Broker routing delivers messages based on the name of the service, rather than on the network address of the computer where the service runs. This allows you to install an application on multiple computers without changing application code.
32
32
33
-
-**Ability to use existing knowledge:** Service Broker uses Transact-SQL to create objects. Applications that use Service Broker are most often implemented in Transact-SQL or Microsoft .NET Framework-compatible languages. You do not have to learn a new language to create Service Broker applications.
33
+
-**Ability to use existing knowledge:** Service Broker uses Transact-SQL to create objects. Applications that use Service Broker are most often implemented in Transact-SQL or Microsoft .NET Framework-compatible languages. You don't have to learn a new language to create Service Broker applications.
34
34
35
-
## See also
35
+
## Related content
36
36
37
-
-[Creating Service Broker Objects](creating-service-broker-objects.md)
37
+
-[Create Service Broker objects](creating-service-broker-objects.md)
38
38
-[Overview (Service Broker)](overview.md)
39
-
-[Creating Service Broker Applications](creating-service-broker-applications.md)
39
+
-[Create Service Broker applications](creating-service-broker-applications.md)
Service Broker uses three system message types to communicate status and error information from Service Broker.
18
18
19
-
## Handling System Messages
19
+
## Handle system messages
20
20
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 messagetype 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.
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.
22
22
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).
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. Service Broker uses these message types 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 [Handle Service Broker error messages](handling-service-broker-error-messages.md).
24
24
25
-
## Error Messages
25
+
## Error messages
26
26
27
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.
28
28
@@ -45,19 +45,19 @@ A receive operation receives an error message before any message for that dialog
45
45
46
46
When an error message arrives for a dialog, the broker raises an error if an application tries to send a message on that dialog. However, an application can receive any remaining messages for the dialog, even after it receives an error message.
47
47
48
-
## End Dialog Messages
48
+
## End dialog messages
49
49
50
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`.
51
51
52
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.
53
53
54
-
## Dialog Timer Messages
54
+
## Dialog timer messages
55
55
56
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.
57
57
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.
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 timeout message arrived on the queue.
59
59
60
-
## See also
60
+
## Related content
61
61
62
62
-[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)
0 commit comments