Integrating Integrators – BizTalk, Windows Azure, Windows Workflow, and Beyond
Join
Sign in
Search Options
Search Everything
Search BizTalk Blogs
Home
AppFabric
BizTalk Server
Windows Azure
Windows Workflow
Jobs (Hire A Guru)
More ...
Home
»
BizTalk Server
»
BizTalk Blogs
»
BizTalk Community Blogs via Syndication
»
Service Bus Messaging: Queues, SB-Messaging Adapter
Service Bus Messaging: Queues, SB-Messaging Adapter
BizTalk Blogs
This group is for blogs related to BizTalk Server. This includes Community Syndicated blogs and Stephen W. Thomas’s blog.
Get this RSS feed
Home
Blogs
Sitewide Application Navigation
Home
Blogs
Media
Forums
Wikis
Groups
Options
Share this
Monthly Archive List
Archives
May 2013
(44)
April 2013
(70)
March 2013
(65)
February 2013
(57)
January 2013
(79)
December 2012
(63)
November 2012
(68)
October 2012
(74)
September 2012
(66)
August 2012
(63)
July 2012
(77)
June 2012
(101)
May 2012
(64)
April 2012
(64)
March 2012
(68)
February 2012
(48)
January 2012
(34)
December 2011
(61)
November 2011
(44)
October 2011
(76)
September 2011
(66)
August 2011
(46)
July 2011
(66)
June 2011
(75)
May 2011
(58)
April 2011
(46)
March 2011
(65)
February 2011
(62)
January 2011
(76)
December 2010
(67)
November 2010
(140)
October 2010
(154)
September 2010
(143)
August 2010
(120)
July 2010
(86)
June 2010
(116)
May 2010
(91)
April 2010
(120)
March 2010
(98)
February 2010
(103)
January 2010
(107)
December 2009
(64)
November 2009
(118)
October 2009
(127)
September 2009
(89)
August 2009
(74)
July 2009
(115)
June 2009
(129)
May 2009
(134)
April 2009
(136)
March 2009
(161)
February 2009
(100)
January 2009
(107)
December 2008
(107)
November 2008
(106)
October 2008
(173)
September 2008
(146)
August 2008
(139)
July 2008
(101)
June 2008
(115)
May 2008
(120)
April 2008
(134)
March 2008
(104)
February 2008
(136)
January 2008
(106)
December 2007
(73)
November 2007
(135)
October 2007
(143)
September 2007
(138)
August 2007
(144)
July 2007
(139)
June 2007
(139)
May 2007
(166)
April 2007
(199)
March 2007
(200)
February 2007
(188)
January 2007
(182)
December 2006
(151)
November 2006
(149)
October 2006
(184)
September 2006
(147)
August 2006
(124)
July 2006
(125)
June 2006
(125)
May 2006
(89)
April 2006
(63)
March 2006
(83)
February 2006
(40)
January 2006
(42)
December 2005
(16)
November 2005
(32)
October 2005
(17)
September 2005
(29)
August 2005
(15)
July 2005
(11)
June 2005
(45)
May 2005
(39)
April 2005
(28)
March 2005
(14)
February 2005
(16)
January 2005
(18)
December 2004
(14)
November 2004
(13)
October 2004
(11)
September 2004
(26)
August 2004
(8)
July 2004
(9)
June 2004
(2)
May 2004
(2)
April 2004
(2)
March 2004
(2)
February 2004
(1)
Tags
.Net
.NET Framework
AppFabric
Architecture
ASP.NET
Azure
BizTalk
BizTalk 2006
BizTalk 2009
BizTalk 2010
BizTalk Server
Cloud
Community News
General
Microsoft
REST
SharePoint
SOA
Tellago
Uncategorized
Visual Studio
WCF
WCF/WF
Web Services
WF
BizTalk Community Blogs via Syndication
Numerous BizTalk Bloggers all in one spot. All content is property of the original blog owner.
RSS for posts
Service Bus Messaging: Queues, SB-Messaging Adapter
Rate This
Syndicated BizTalk Author
Thu, Nov 1 2012 4:40 PM
Comments
0
Like some of you I have been experimenting with the Service Bus Queues, Topics and subscriptions. The information from Microsoft gives you a straight forward insight how to send messages to
queues
,
topics and subscriptions
using .NET. The first step to interact with the Service Bus Queues, Topics and subscriptions is by creating an account with Windows Azure through
a trail or buy option
. The next step is creating a service namespace through the Windows Azure Portal followed by obtaining the management credentials you need when setting up Service Bus Connection string. To create a solution that can interact with the Service Bus you need to have a reference in your Visual Studio project to the
Microsoft.ServiceBus.dll
on your machine, which is a part of the
Windows Azure SDK
. In your code template (for instance C# form) you will add two using statements:
using Microsoft.ServiceBus;
using Microsoft.ServiceBus.Messaging;
Now everything is setup for coding your interaction with the Service Bus. In this post I will show my sample I have built that sends messages to the queue. These messages are then read by the
SB-Messaging Adapter
from BizTalk Server 2010 R2 CTP. BizTalk Server is on a VM in the cloud (see my post on
BizTalk Virtual Machine in Windows Azure using Quick Create
and
BizTalk Virtual Machine in Windows Azure using Quick Create–Part II
). These messages are then stored in SQL Server 2008 R2 table using the BizTalk Server 2010 R2 CTP Adapter Pack WCF-SQL Adapter. Below you will see the diagram of the solution.
The client application is a .NET Windows Form application that will send messages to a queue in Windows Azure Service Bus. An application in BizTalk Server 2010 R2 has a port with a receive location configured with SB-Messaging Adapter. With the port a mapping will be performed to Insert Operation Message format. A send port has a subscription on messages with the SQL Insert format. The send port will send the messages to SQL Server 2008 R2 resulting in inserts in a SQL Table.
The client application
The client application is a Windows Form application. It has one form, where details can be filled for a runner like Name, number and time. I use the participants textbox to simulate a load to the Service Bus (see the latency section).
When I hit submit after filling in participants (i.e. 1), name, number and time the runner information will be sent a message to the Service Bus Queue.
The Service Bus Queue
Service Bus queue can be created through code, the service bus explorer within Visual Studio 2012, the Service Bus Explorer created by
Paolo Salvatori
(see my post
Visual Studio Service Bus Explorer versus Standalone Service Bus Explorer
) or through Windows Azure Portal.
BizTalk Server 2010 R2 Solution
The BizTalk Server solution consists of a schema of incoming messages from the Service Bus (runner message), a map and schema’s generated through Adapter Metadata Utility (i.e. Consume Adapter Service Add-in in Visual Studio 2012, see also TechNet Wiki
article
on Adapter Pack). Below you can see the artifacts created in a BizTalk project in Visual Studio 2012
Runner Schema
SQL Insert Operation Schema
Map
The solution is deployed to the BizTalk runtime and configured through the BizTalk Administration Console. The interesting part is the configuration of the receive location using the SB-messaging adapter.
Configuring the SB-Messaging Adapter
The first tab for configuring the SB-Messaging is setting the URL for Queue (see picture of the Service Bus Queue:
QUEUE URL
). In the Second Tab the Authentication you provide the management credentials of the namespace (
BTUGNLD
).
The final tab properties you can enable promotion of Brokered Message Properties.
The configuration of the receive location is straight forward as you can see. The information on configuring this adapter in a receive location can be found on MSDN:
How to Configure an SB-Messaging Receive Location
.
Running the solution
When I run the client application a form will appear, where I can fill in the details of a runner.
After filling in the detail I hit submit. When a message is send I can see the duration of sending the message from the client to Service Bus Message Queue. On average it takes less than a second. On my VM in Windows Azure I query the
RegisteredTimes
table and will see the details of the runner.
Latency
Sending one message to Service Bus queue takes less than a second. Sending a 100 messages (setting participants to 100) will take about 2 seconds.
Number of Messages
Duration (Latency) in seconds
Messages/Sec
1
0.665
1.50
10
1.59
6.29
100
9.15
10.92
200
14.39
13.89
500
35.84
13.95
1000
68.07
14.69
10000
707
14.14
100000
~7142
~14
As soon as the client is finished with sending the messages I instantly check the database in my VM and query number of records in the table. All the records are there. So it's safe to say that latency to have all messages pulled from the queue and inserted in SQL table is around the same time (i.e. duration to send to queue and few milliseconds later). With number of messages increasing the average duration (latency) is far less than a second to send a message to queue and then pick it up from queue to insert the message (data) into a table.
Throughput
Now
100000
messages would take about an 2 hours (extrapolate with measured data below) to be inserted in SQL Server table.
Usage Overview
Below you can see the number of messages going through the Service Bus Queue “
registeredtimes
”. There is a latency of a few minutes before actual number are shown (it is near real time).
Overall I am very impressed with this solution. Messages sent so quickly to a Service Bus queue and are then picked up by BizTalk Server 2010 R2 using the SB-Messaging adapter to store data in SQL Server 2008 R2. Image that I would like to register all the finishing times of a marathon with
50000
participants or all finishing times including passing the 5, 10, 15, 20, 25 ,30, 35 and 40 km mark. That would accumulate in
450.000
messages. This can be quite some time (a few hours, see throughput) so scaling out with more queues, tune SQL Server and BizTalk would be a way to shorten the time.
You could of course use a queue for 5, 10, 15, 20, 25 ,30, 35, 40 km and finish mark. Or you could use topics and subscriptions for this. In my next post I will discuss a solution that will support this scenario using queues and topics/subscriptions including some fine tuning of the BizTalk / SQL Server. Interesting to see the latency and throughput then.
Stay tuned!
Read the complete post at
feedproxy.google.com/.../service-bus-messaging-queues-sb.html
Windows Azure
,
Service Bus
,
BizTalk Server 2010 R2