Database Reference
In-Depth Information
The PayQueue sample
From these frameworks and the use of SQL Queuing, we will be introducing a PayQueue
sample that will be evolving over some of the following chapters.
The solution will start with four projects:
•
MyMessages
: This contains the common messages—currently
EventMessage
given previously
•
AppForWritingXML
: This contains the application to write XML messages to
disk
•
AppForWritingTables
: This contains Entity Framework and C# refection to
populate the PayQueue
Payments
table with the event message data
•
AppForReadingXML
: This reads the sample XML files from disk, populates the
Payments
table, and sends the data through a SQL Queue
Many of the snippets have already been covered in part. The part that remains is sending it
across the bus in SQL Queuing. We set the logging (log4net in this case), configure the bus,
and send the message.
The installation piece creates the endpoints in SQL Server, and it knows to do this because
the transport is set to
<SqlServer>
:
// Set the log4net
SetLoggingLibrary.Log4Net(log4net.Config.XmlConfigurator.Configure);
// Configure the Bus
bus = Configure.With()
.DefaultBuilder()
.UseTransport<SqlServer>()
.UnicastBus()