ServiceBrokerTicketMaster is a very small example of how you can take advantage of SQL Service Brokers message queues from witin an ASP.Net MVC application.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

#Using Service Broker With ASP.Net MVC

This is a demo/sample project to show the use of SQL Service broker from within an ASP.Net MVC site.

It's a ticketing site that when a booking is made sends asynchronus messages to Service Broker services to process the payment and print the tickets. This sample shows how you could run the payment processor and the ticket printer applications on different machines away from your SQL Server and have them receive/process messages. It also gives an example of multithreading the queue receivers.


  • Once you have opened the solution in Visual Studio publish the TicketMasterDb database project to your SQL server to create the database.
  • In the BrokerTicketingExample project change the connection string in Web.Config to point to the database you published.
  • Do the same for the app.config files in the PrintProcessor/PaymentProcessor console apps.
  • You can then run the BrokerTicketingExample MVC app and create bookings.
  • It's best if you are running the PaymentProcessor/PrintProcessor at the same time as the MVC app as then you can watch the messages go through.