SQL SERVER – Introduction to Service Broker

Service Broker is message queuing for SQL Server. It is used for sending emails and through Database Mails. You can read about SQL SERVER – Difference Between Database Mail and SQLMail here. Service Broker is a feature which provides facility to SQL Server to send an asynchronous, transactional message.

SQL SERVER - Introduction to Service Broker servicebroker-800x200

So how it works is SQL Server uses Service Broker to send message from database to message queue. This message is then picked up by different processes to send this message to its destination. This separate process can be using SMTP protocol. Sending and receiving processes can be done using entirely different system or SQL Server instance. It is not required that both the services are online at the same time. Sending services or Receiving services both are not required to be online at the same time.

In summary, Services Broker follows traditional client-server architecture. Here client service initiates a conversation and receiving services takes messages and processes to send it to its destination.

Database mail is a newly introduced concept in SQL Server 2005 and it is the replacement of SQLMail of SQL Server earlier version. Database Mail has many enhancements over SQLMail. Database Mail is based on SMTP (Simple Mail Transfer Protocol) and also very fast and reliable where as SQLMail is based on MAPI (Messaging Application Programming Interface).

Reference: Pinal Dave (https://blog.sqlauthority.com)

Database Mail, Service Broker, SQL Server
Previous Post
SQLAuthority News – Updated My Personal Book Mark Pages
Next Post
SQL Server – Fix – Error : 9692 The _MSG protocol transport cannot listen on port because it is in use by another process.

Related Posts

6 Comments. Leave new

  • can i get a walk through of service broker
    or else where can i get the examples of service broker implementation

    Reply
  • HI Pinal,

    Nice Document given by you..
    which may be very helpful in my project.
    I have to fire automatic mail in project.

    so thanks a lot for this doc…

    Reply
  • hi, thanks for the great document, is it possible for me to send automated (daily)e-mails that gets the results of different stored procedures?

    Reply
  • “Service Broker is message queuing for SQL Server. It is used for sending emails and through Database Mails.”…
    So simplistic, Pinal… Is that all you want to say?

    Reply
  • Hi pinal,
    Thank you for sharing important stuff

    Reply

Leave a Reply