Building Hybrid Applications using the Azure Service BusDavid InghamSenior Program Manager, Service Bus Team3-033
Service Bus overview Recent developments with SDK 1.8Service Bus for Windows ServerCross-platform hybrid apps
Agenda
Unified set of messaging capabilities Consistent management and observation capabilities
Service Bus RelayRich options for interconnecting apps across network boundaries
Service Bus Brokered MessagingQueuing, publish/subscribe
Easily build hybrid apps
What is Service Bus?
Service Bus Relay
Service Bus
Sender Receiver
Frontend Nodes
Ctrl
Forwarderou
tbou
nd
sock
et
connec
t
outbound
socket
rendezvous
Ctrl
NLB
• Integrated w/ WCF programming model
• Using Outbound Connections Only
• No open inbound firewall/NAT ports
• Outbound connections default to TCP
• Fall back to HTTP when needed
• Guarded by Datacenter Firewall
• Secured with Access Control
Showcasing Service Bus Relay
DemoRemoting a WCF service
Audience Participationhttp://tinyurl.com/sbrelay
Message queuing (Queues)Publish/subscribe (Topics, Subscriptions)Enables loosely-coupling
Service Bus Brokered Messaging
Tightly Coupled
Store Front End
Drivers
Shipping Service
Tracking
Store Front End
Shipping Service
Drivers
Tracking
Tightly Coupled
Store Front End
Drivers
Shipping Service
Tracking
Order Queue
Loosely Coupled
Store Front End
Order Queue Shipping Service
Drivers
Tracking
Loosely Coupled
Store Front End
Order Queue Shipping Service
Drivers
Tracking
Loosely Coupled
Store Front End
Order Queue
Tracking
Tracking
Shipping Service
Loosely Coupled
Service Bus Queue
QueueS R
S
S
R
R
Sequential message log with shared cursor and locksCan have competing consumersEach message published is consumed by a single consumer
Service Bus Topic
S
S
S
Sequential message log; each subscription has own lock/cursorSubscribers can filter, based on message propertiesEach message published is available to each subscription
Topic
SubsR
R
RR
R
PropertiesKey/value pairs exposed to the brokerSubscription rules can filter based on properties
BodyOpaque payload not exposed to the brokerCan be used for encrypted data
BrokeredMessage
Brokered Message
Body
Properties
Key Value
Key Value
Key Value
Key Value
Body
Showcasing Service Bus Brokered Messaging
DemoMartVue: Retail Insight In Real Time
Retail Points of Sale
Inventory and Fulfillment
Centers
Business Operations
Real Time Retail
Analytics
?
Store Queue
Service Bus
Inventory
Store Queue
Service Bus
Inventory
Load Leveling
Store Queue
Service Bus
Inventory
Store
Store
Store
Load BalancingInventor
y
StoreData Collection
Topic
Service Bus
InventorySub
Sub
Audit
Audit Taps
StoreData Collection
Topic
Service Bus
InventorySub
Sub
Audit
Sub
Dashboard
Real-Time Observation
StoreData Collection
Topic
Service Bus
InventorySub
Sub
Audit
Sub
Dashboard
Sub
MartVue Analyzer
Analysis Topic Sub
Real-Time Analysis
StoreData Collection
Topic
Service Bus
InventorySub
Sub
Audit
Sub
Dashboard
Sub
MartVue Analyzer
Analysis Topic Sub
Catalog TopicSub
Scale-OutEventing
New Service Bus features inWindows Azure SDK 1.8
Message auto-forwardingLink together queues & topics Build rich messaging flowsScale out topicsFan-in from several queuesReduce coupling
QueueDescription destinationQ = new QueueDescription("myQ2");QueueDescription sourceQ = new QueueDescription("myQ1");sourceQ.ForwardTo = “myQ2";
Supports long running workflowsMaximum lock duration is 5 minutesCan renew lock repeatedly
Message lock renewal
QueueClient queueClient = QueueClient.Create("myQ");BrokeredMessage message = queueClient.Receive();message.RenewLock(); message.LockedUntilUtc; // check to see when you need to renew
Pause queues & topics
Useful in multi-tenant appsSend ops blocked for disabled queues and topicsReceive ops blocked for disabled queues and subscriptions
QueueDescription qd = namespaceManager.GetQueue("myQ");qd.Status = EntityStatus.Disabled;namespaceManager.UpdateQueue(qd);qd.Status = EntityStatus.Active;namespaceManager.UpdateQueue(qd);
Send-time filter evaluationEvaluate filters at the time of message sendWarn if no subscriptions matchWorks with all types of filters
TopicDescription td = new TopicDescription("Topic");td.EnableFilteringMessagesBeforePublishing = true;// throws NoMatchingSubscriptionException on send
Improved monitoring
View details of “sub queues”Active, dead-letter, scheduled, transfer queues
Available as part of Description objects
NamespaceManager nm = NamespaceManager.Create();QueueDescription myQ = nm.GetQueue("myQ");var active = myQ.MessageCountDetails.ActiveMessageCount;var deadLettered = myQ.MessageCountDetails.DeadLetterMessageCount;var scheduled = myQ.MessageCountDetails.ScheduledMessageCount;var transfer = myQ.MessageCountDetails.TransferMessageCount;
New API capabilities in SDK 1.8 Message lock renewalMessage auto-forwardingPause entitiesSend-time filter evaluationsImproved monitoringBatching APIs for sending and receiving groups of messagesConsistent send of messages to multiple entitiesSession browsing
Service Bus for Windows Server
On-premises messaging scenarioWhy & What
On-Premises pub-sub •Enterprise applications developed and deployed on-premise.•Scale ; HA ; Manageability ; Rich messaging feature set
Develop On-premise •High fidelity develop, test, debug experience•DevBox deployment (HW&SF pre-reqs) ; Tools (VS); debug mode ; symmetry
Flexible Deployment•Driven by enterprise desire for deployment choice•Full symmetry ; Ease of migration
Tiered Deployment •Maintain control of mission critical data / systems•Unable/unwilling to migrate legacy systems•Gradual migration to cloud•Message Federation
On-premise
Cloud
Deploy
DeployDeploy
DataApp
Develop
Develop&Deploy
Cloud and on-premise symmetryGet the connection string from the ConfigWizard or the following cmdLet:
string connectionString = ConfigurationManager.AppSettings["Microsoft.ServiceBus.ConnectionString"];MessagingFactory factory = MessagingFactory.CreateFromConnectionString(connectionString);NamespaceManager namespaceManager = NamespaceManager.CreateFromConnectionString(connectionString);
<appSettings> <add key="Microsoft.ServiceBus.ConnectionString" value="Endpoint=sb://hostName/ServiceBusDefaultNamespace;
StsEndpoint=https://hostName:9355/ServiceBusDefaultNamespace; RuntimePort=9354;ManagementPort=9355"/> </appSettings>
PS C:\Program Files\Service Bus\1.0> Get-SBClientConfigurationEndpoint=sb://hostName/ServiceBusDefaultNamespace; StsEndpoint=https://hostName:9355/ServiceBusDefaultNamespace; RuntimePort=9354;ManagementPort=9355
Paste it in to your configuration file:
Use it in your code:
Cross-platform hybrid apps
Message-oriented middleware allows application modules to be distributed over heterogeneous platforms and reduces the complexity of developing applications that span multiple operating systems …
--Wikipedia’s entry for message-oriented middleware
Difficult to port applicationsRequires re-coding all applications
Difficult to integrateApplication level bridges to move messages and translate message formats
Restricted platform supportLimited to whatever vendor provides
Proprietary messaging protocols
Open, standard messaging protocolEnables cross-platform apps to be built using brokers, libraries and frameworks from different vendors
FeaturesEfficient – binary connection-oriented protocolReliable – fire-and-forget to reliable, exactly-once deliveryPortable data representation – cross-platform, full-fidelity exchangeFlexible – client-client, client-broker, and broker-broker topologiesBroker-model independent – no requirements on broker internals
Advanced Message Queuing Protocol 1.0
This week OASIS announced the ratification of the AMQP 1.0 StandardSoftware vendors and end-users can bet on AMQP 1.0 knowing it’s a stable, well-supported protocol standardThe culmination of several years effort by more than 20 companiesTechnology vendors: Axway Software, Huawei Technologies, IIT Software, INETCO Systems, Kaazing, Microsoft, Mitre Corporation, Primeton Technologies, Progress Software, Red Hat, SITA, Software AG, Solace Systems, VMware, WSO2, Zenika. User firms: Bank of America, Credit Suisse, Deutsche Boerse, Goldman Sachs, JPMorgan Chase.
Announcement:
OASIS AMQP 1.0 Standard released
“AMQP 1.0 is a novel addition to the growing toolkit of open protocols for transporting data between systems and virtualized application delivery. Standard transports enable lower cost business integration and messaging. AMQP 1.0 admits many use cases by defining safe message transfer between peers, without the constraint of a message broker model. With its open license, we anticipate both AMQP's wide adoption by messaging servers, and its use as a new API for database and integration products.”
--Alexis Richardson, Senior Director
VMware
“Red Hat is pleased to see the hard work of the Technical Committee come to fruition. We are a founding member of the AMQP Technical Committee and have been active on the specification since the early days. AMQP 1.0 represents a significant improvement in the messaging arena and we expect to continue to support it in our products to best customer needs.”
-- Mark Little, Vice President, Middleware Engineering
Red Hat
“A platform independent and vendor neutral protocol like AMQP removes hurdles in advancing interoperability of message-oriented middleware technologies. As a founding sponsor member of the AMQP TC and the related AMQP Steering Committee, Software AG is very pleased to see AMQP 1.0 transition to an OASIS Standard. Software AG supports numerous standards in its product suite, and AMQP has been an important addition to webMethods Nirvana, increasing interoperability and providing advanced messaging capabilities to our customers.”
-- Prasad Yendluri, VP & Deputy CTO
SoftwareAG
“As the enablers of the Living Web and HTML5 WebSocket technology, everyone at Kaazing is excited to support OASIS' ongoing efforts to proliferate open standards and create a superior user web experience. Standardizing AMQP and combining it with WebSocket technology is an excellent strategy when building an event driven architecture. Working alongside OASIS, Kaazing has developed a Living Web in order to create the best possible web experience for users, reduce complexity, and increase interoperability.”
-- John Fallows, CTO and Co-Founder
Kaazing
“Microsoft congratulates the AMQP community on approval of AMQP version 1.0 as an OASIS Standard. As an open and interoperable messaging protocol that can scale from mobile clients to the cloud, AMQP has benefitted from the participation of technical experts from around the world, and the achievement of this important milestone will lead to continued growth in the AMQP ecosystem. We look forward to working with the community to promote AMQP-based interoperability and innovation.”
-- Scott Guthrie, Corporate VP, Microsoft's Server and Tools Business Division
Microsoft
AMQP 1.0 preview available today in Azure Service BusUpdated Service Bus client library availableSupport for a range of third-party client librariesMore platforms will be supported as libraries become availableGeneral availability in H1 2013
Announcement:
Service Bus AMQP 1.0 preview
Support for multiple protocols
“SBMP”high perf..NET only
AMQP 1.0high perf
high reach
HTTPhigh reachlower perf.
App ( any language
)Community Libs
AMQP 1.0Any OS
App ( .NET )
SB .NET Lib“SBMP”Windows
App ( any language
)SB Wrappers
HTTPAny OS
.NET, Node.js, Java, PHP, Python
AMQP 1.0 client libraries
Language Library
C# Service Bus .NET Client Library
Java Apache Qpid Java Message Service (JMS) clientIIT SwiftMQ Java client
C Apache Qpid Proton-C
PHP Apache Qpid Proton-PHP
Python Apache Qpid Proton-Python
Ruby Apache Qpid Proton-Ruby (coming soon)
Perl Apache Qpid Proton-Perl (coming soon)
JavaScript Apache Qpid Proton-JavaScript (coming soon)
Showcasing support for cross-platform hybrid apps using Service Bus and AMQP 1.0
DemoPictureMagic
Transform Requests
Topic
Subs
RQ
Image Transforme
rApp
ClientApp
MessageId = 1234ReplyTo = RQ
MessageId = 5678CorrelationId = 1234
Service Bus
Transform Requests
Topic
Win
dow
s (o
n-p
rem
)Li
nux
(Azu
re)
Archiver
Monitor
Transformer
SwiftMQBroker
SummaryService Bus provides a unified set of messaging capabilitiesWindows RT client library available nowNew tooling and feature enhancements in SDK 1.8Service Bus for Windows Server available nowAMQP 1.0 preview available now in Azure Service Bus
More informationWinRT library (in Windows Azure SDK for Windows 8)Docs: http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.messaging.aspxBits: http://go.microsoft.com/fwlink/?LinkId=257545&clcid=0x409
SDK 1.8 updatesDocs: http://msdn.microsoft.com/en-us/library/jj737688.aspxBits: https://www.windowsazure.com/en-us/develop/downloads/
Service Bus for Windows ServerDocs: http://msdn.microsoft.com/en-us/library/windowsazure/jj193022(v=azure.10).aspxBits: http://www.microsoft.com/en-us/download/details.aspx?id=35374
Service Bus AMQP 1.0 previewDocs: https://www.windowsazure.com/en-us/develop/net/how-to-guides/service-bus-amqp-overview/Bits: http://nuget.org/packages/ServiceBus.Preview
Thank you. Any questions?
• Follow us on Twitter @WindowsAzure
• Get Started: www.windowsazure.com/build
Resources
Please submit session evals on the Build Windows 8 App or at http://aka.ms/BuildSessions
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Top Related