The document discusses building scalable and robust solutions using Service Bus in cloud and server environments. It describes how Service Bus can be used to connect applications, enable hybrid configurations, and support connected client scenarios. Examples are provided around using Service Bus for game stats integration, retail integration, enterprise application integration, and connected client notifications. The key capabilities of Service Bus around messaging, queues, topics, and relays are also summarized.
Building Scalable and Robust Solutions with Service Bus in Cloud and Server
1. Building Scalable and Robust
Solutions with Service Bus in Cloud
and Server
Clemens Vasters (@clemensv)
Principal Technical Lead / Architect
Windows Azure Application Platform Team – Service Bus
2. Appliances Phones & Tablets PC SaaS Cloud app
Queues Topics Relays Notifications
Team SharePoint
LOB Apps Event Aggregator site ....
5. XBox Leaderboard Game Stats
Devices Devices
XBox
Gateway Role Service Bus Queues Halo Backend Role Xbox Live
XBox
1. Game scores fan-in to Queues
2. Sessions used to correlate games
3. Scheduled messages to track completion
XBox 4. Halo backend produces finalized stats
6. Retail Services ISV
POS
POS
Retail Web Services
Service Bus Queues IT Admin
POS
Service Bus Topics Marketing
Sales data fan-in to Queues
Messages processed and appropriate messages sent
Topics used to support Publish-Subscribe for messages
POS Real-time monitoring as well as decoupled inventory updates
7. Enterprise Services ISV
Service Bus Relay
ISV
Suite
Policy Updates Remote
Management
Enterprise Private Cloud
Central
Repository
ISV Private Cloud • ISV Suite offers a turn-key solution for security & management of
BYOD
• Deployed on enterprise networks behind firewalls/NATs
• Uses Service Bus Relay to push policy updates/templates and
perform remote management of the Suite
8. CRM Online
CRM Online
Service
Windows 8 1. Devices Authenticate with CRM
2. Registration sent to Notification Hub
3. Message initiated by CRM Online Service
4. Customized Notifications to all devices
Service Bus
Notification Hub
Win Phone 8
WNS
Filter w/ Tags Broadcast Scale Templates
iOS
APNS
9.
10.
11.
12.
13.
14. Apps
.NET WCF Service Model
C/C++ Java/JMS
(incl
Embedded) Node.j Any
Python PHP
NetMessagingBinding Apache Qpid s HTTP
client client
Apache JMS AMQP client client
Proton-C 1.0
.NET Service Bus Messaging API
SB Messaging Protocol
AMQP 1.0 HTTP(S)
(net.tcp, proprietary)
Service Bus
24. Service Bus Message
Sys Properties
Key Value
Key Value
Key Value
Custom Properties
Key Value
Key Value
Key Value
Key Value
Body
Body
(Bag of Bytes)
25. Broker
Receive and Delete
Broker 1. Peek/Lock
2. Delete/Unlock
41. var sender = QueueClient.CreateFromConnectionString(cs, "test");
sender.Send(new BrokeredMessage
{
Label = "Hello"
});
// Send a message with system and application properties set
var bm = new BrokeredMessage();
bm.Label = "PurchaseOrder123";
bm.TimeToLive = new TimeSpan(0, 5, 0);
bm.Properties["PurchaseOrderID"] = 1234;
sender.Send(bm);
42. var receiver1 = QueueClient.CreateFromConnectionString(cs, "test",
ReceiveMode.ReceiveAndDelete);
var msg1 = receiver1.Receive();
var receiver2 = QueueClient.CreateFromConnectionString(cs, "test",
ReceiveMode.PeekLock);
var msg2 = receiver2.Receive();
try
{
// Process msg2
msg2.Complete();
}
catch
{
msg2.Abandon();
throw;
}
45. QueueDescription destinationQ = new QueueDescription("myQ2");
QueueDescription sourceQ = new QueueDescription("myQ1");
sourceQ.ForwardTo = "myQ2";
NamespaceManager nm = NamespaceManager.Create();
nm.CreateQueue(destinationQ);
nm.CreateQueue(sourceQ);
46. DeviceId = ‘123’ OR UserId = ‘clemensv’
OR Group IN (‘A’, ‘B’, ‘C’)
Group IN (‘A’, ‘B’,
‘C’, ‘D’, ‘E’) DeviceId = ‘456’ OR UserId = ‘clemensv’
OR Group IN (‘A’, ‘B’, ‘C’)
47.
48. HTTP SBMP/AMQP
HTTP
1 Entity per Socket
1 Pending Operation per Socket
60s operation timeout (NAT/Prx)
SBMP/AMQP
Unlimited Multiplexed Entities and
Unlimited Pending Ops per Socket
No fixed operation timeout
Session Support (coming in AMQP)
49.
50. Browsers
Long Polling, Web Sockets, Server-Side Events, Forever-Frame
Connections
Key Value
IMessageBus
key1
Filtered key2
Receive …
keyN
51. Composite Cursor
Node A Node B
IMessageBus IMessageBus
Topic A B
Throughput
Topic A B
Scale-Out
Topic A B
Client Pinning
52. Node A Node B
Socket.io Socket.io
Topic A B
Throughput
Topic A B
Scale-Out
Topic A B