windows azure service bus
DESCRIPTION
Windows Azure Service Bus. Name Title Organization. Agenda. Why Service Bus? Service Bus Namespace and Access Control Service Bus Relay Service Bus Messaging. Service Bus. Connectivity Service Relay Protocol Tunnel Eventing. Integration Routing Coordination Transformation. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/1.jpg)
Windows Azure Service BusNameTitleOrganization
![Page 2: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/2.jpg)
Agenda
Why Service Bus?Service Bus Namespace and Access ControlService Bus RelayService Bus Messaging
![Page 3: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/3.jpg)
ServiceBus
ConnectivityService RelayProtocol Tunnel Eventing
Rich options for interconnecting apps across network boundaries
Integration RoutingCoordination Transformation
Content-based routing, document transformation, and process coordination.
Svc Management Naming, DiscoveryMonitoring
Consistent management surface and service observation capabilities
MessagingQueuing Pub/SubReliable Transfer
Reliable, transaction-aware cloud messaging infrastructure for business apps.
![Page 4: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/4.jpg)
Why Service Bus?
![Page 5: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/5.jpg)
Cloud/On-Premise IntegrationCloud-Hosted, reliable asynchronous Messaging Infrastructure with Publish/SubscribeCloud-Based Relay enabling NAT/Firewall Traversal for reach into on-prem assets
![Page 6: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/6.jpg)
Cloud/On-Premise IntegrationService Registry that allows organizing endpoints into a common, discovery enabled network surface for services spread across different network environmentsIntegration with Access Control providing security gate with Federated Identity support
![Page 7: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/7.jpg)
Cross-Site Federation (SaaS)Endpoint Federation instead of Network Federation (VPN)Non-intrusive, does not require network reconfigurationEnables integration scenarios with:Multi-TenancyMinimal mutual trustMinimal or no control over the on-premise networking environment
![Page 8: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/8.jpg)
Trade Franchise Partner IntegrationEnables integration across partners and franchise environmentsLow trust Limited controlDiverse sites with varying connectivityDirect peer access and cloud access
![Page 9: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/9.jpg)
Mobile Workforce/Customer IntegrationMobile devices are largely not “behind the firewall”VPN solutions are largely impractical due to setup and management complexity
![Page 10: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/10.jpg)
Mobile Workforce/Customer IntegrationYet, mobile devices need access to on-premise assetsIn reach for larger enterprises, not so much for smaller ones without static or at least public IPs
![Page 11: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/11.jpg)
Mobile Workforce/Customer IntegrationDirect access, access via the cloud using ISV supplied servicesIn the future also support for Azure inherent mobile services such as Service Bus Push support for mobile
![Page 12: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/12.jpg)
Federated Cloud/On-Prem SolutionsFederated solutions provide the same functionality in the cloud and on-premiseCloud enhances the on-premise solution by providing reach and scaleOn-premise solution provides no-compromise availability even in case of a full network outage
![Page 13: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/13.jpg)
Smart Grid System
Large Scale Eventing / Command-Control
“Last Mile” problem of reaching into the consumer householdReach consumer or industrial devices at scaleBroadcast event data at “utility scale” Send targeted notifications based on geography or demographicsLarge scale notifications and broadcast will become part of Service Bus in CY12
Smart Grid System
Smart Grid System
![Page 14: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/14.jpg)
Service Bus Namespace and Access Control
![Page 15: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/15.jpg)
Service Bus Namespacehttps://yourapp.servicebus.windows.net/foo/bar/baz
Naming treeATOM Feed at the root for discoveryManagement via REST on the ATOM feed hierarchyAll names that can exist do exist
“Infinite” depth Factually: 32 segments, 450 character path limit
Entities own the namespace tree leavesAny branch can be differently secured with ACS
![Page 16: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/16.jpg)
Service Bus and Access ControlSpecial relationship between Service Bus and ACSEach SB namespace has a ‘buddy’ namespace in ACS‘yourapp.servicebus.windows.net’‘yourapp-sb.accesscontrol.windows.net’
‘-sb’ namespacesPreconfigured relying party for Service Bus namespace rootCan‘t be deleted, system-managed signing key, uses default rule groupPreconfigured service identity ‘owner’Can’t be deleted, configured as superuser via default rule group Tokens issued for ‘owner’ assigned ‘Listen’, ‘Send’, and ‘Manage’
![Page 17: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/17.jpg)
Service Bus Rights and ClaimsService Bus defines one authorization claim type with three possible values that indicate the authorized operation(s) ‘net.windows.servicebus.action’ ‘Send’ – Permit ‘send’ operations on a Service Bus entity‘Listen’ – Permit ‘send’ or ‘receive’ operations on a Service Bus entity‘Manage’ – Permit management operations like creating, inspecting, or deleting Service Bus entities.
![Page 18: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/18.jpg)
Access Control – Conceptual ModelEach name/branch in
the namespace can have a set of associated mappings from ‘claims’ to ‘rights’‘Claims’ are issued by identity providers federated with Access Control‘Rights’ define permissions on Service Bus entities: ‘Send’, ‘Listen’, ‘Manage’
owner: Sendowner: Listenowner: Manage
John: Manage
Fred: SendAlice: SendPeter: Listen
![Page 19: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/19.jpg)
Access Control – Implementationhttps://yourapp-sb.accesscontrol.windows.net
owner: Sendowner: Listenowner: Manage
John: Manage
Fred: SendAlice: SendPeter: Listen
http
Relying Party/Realm Rule Group
http
http
![Page 20: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/20.jpg)
Namespace and Access Control
demo
![Page 21: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/21.jpg)
Service Bus Relay
![Page 22: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/22.jpg)
“Expose Web Services from anywhere to anywhere”
Outbound TCP (Ports 9350-9353)9350 Unsecured TCP One-way (client)9351 Secured TCP One-way (all listeners, secured clients)9352 Secured TCP Rendezvous (all listeners except one-way)9353 Direct Connect Probing Protocol (TCP listeners with direct connect)Outbound HTTP (Port 80, Listeners)TCP equivalent tunnel with overlaid TLS/SSL formed over pair of HTTP requestsAlternate connectivity path if outbound TCP is blockedOutbound HTTPS (Port 443, Senders)
Relayed One-Way Unicast and MulticastRelayed WCF NET.TCP with Direct Connect OptionRelayed WCF HTTP with support for REST and SOAP 1.1/1.2Endpoint protection with Access Control
Key Capabilities
Connectivity Options
![Page 23: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/23.jpg)
Relay Programming ModelFull WCF Programming ModelBindings functionally symmetric with WCFWebHttpRelayBinding (HTTP/REST)BasicHttpRelayBinding (SOAP 1.1)WS2007HttpRelayBinding (SOAP 1.2)NetTcpRelayBinding (Binary transport)Special Service Bus BindingsNetOnewayRelayBinding (Multicast one-way)NetEventRelayBinding (Multicast one-way)Transport binding elements for custom binding stacks
WebHttpRelayBinding provides full interoperability with any HTTP/REST client, BasicHttpRelayBinding with any SOAP client
![Page 24: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/24.jpg)
OnewayNetOnewayRelayBindingAll TCP and HTTP listeners use one-way as internal control channel60KB message-size limitOne-way onlyNo rendezvous overhead
Backend
NamingRouting
Fabric
solution. a b
FrontendNodes
outbound
connect one-way
net.tcp
outbound connect bidi socket
MsgMsg
NATFirewall
Dynamic IP
NLB TCP/SSL HTTP(S)TCP/SSL HTTP(S)
RouteSubscribe
![Page 25: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/25.jpg)
EventNetEventRelayBindingSmall-Scale Synchronous Multicast 60KB message-size limitOne-way onlyNo rendezvous overhead
Backend
NamingRouting
Fabric
solution. a b
FrontendNodes
outbound
connect one-way
net.tcp
outbound connect bidi socket
MsgMsg
TCP/SSL HTTP(S)TCP/SSL HTTP(S)
RouteSubscribe
outbound connect bidi socket
Msg
![Page 26: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/26.jpg)
Rendezvous(TCP & HTTP)
NetTcpRelayBindingWebHttpRelayBindingBasicHttpRelayBindingWS2007RelayBindingRendezvous HandshakeBi-Directional Net.Tcp Full DuplexNo message size limit
solution. a b
NLB
outbound socket rendezvous
HTTP/SocketForwarder
outbound
socket connect
Ctrl
Ctrl
TCP/SSL or HTTP
Backend
NamingRouting
Fabric
FrontendNodes
![Page 27: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/27.jpg)
solution. a bBacken
dNamingRouting
Fabric
FrontendNodes
Hybrid ConnectSpecial Mode of NetTcpRelayBindingTcpRelayConnection-Mode.HybridStarts as relayed connectionPerforms NAT probing and behavior predictionEstablishes direct connection and upgrades if possibleUpgrade driven by trafficTakes large transfers off the RelayNo transfer charges, lower latency
relayed connect
NAT Probing
CtrlNAT Probing
NAT Traversal Connection
Upgrade
Upgrade
relayed rendezvous
Oneway RendezvousCtrl Msg
TCP/SSL HTTP(S)
![Page 28: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/28.jpg)
Service Bus Relay Samples
demo
![Page 29: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/29.jpg)
Service Bus Messaging
![Page 30: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/30.jpg)
Relay vs. Message Broker
The Relay routes messages ‘straight through’ with feedback path and network backpressure into sender
Route
AuthN/Z Backpressure Feedback Relay
Query FilterPull
AuthN/Z Broker
Brokers hold messages for retrieval and querying
![Page 31: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/31.jpg)
Push vs. Pull
‘Push’ is a sender initiated activity that results in delivery of a message to a receiver without the receiver explicitly asking for one or a particular message
Intermediary
Broker
‘Pull’ is a receiver initiated activity that delivers stored messages to the receiver in a context that the receiver controls. The context is decoupled from the ‘Push’ style send operation
![Page 32: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/32.jpg)
Ways to PullReceive and DeleteFastest. Message lost if receiver crashes or transmission fails.
Peek LockMessage is locked when retrieved. Reappears on broker when not deleted within lock timeout.
TransactionalLocal model
Broker
Broker
Broker
![Page 33: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/33.jpg)
Broker Message
MessagesBrokered messaging properties are not SOAP headersProperties are key/value pairs that may very well carry payloadsIt’s not uncommon to have messages with empty message bodiesMessage bodies are useful for a single opaque payload not exposed to the broker (e.g. encrypted content)
Body
Properties
![Page 34: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/34.jpg)
Queues
Load LevelingReceiver receives and processes at its own pace. Can never be overloaded. Can add receivers as queue length grows, reduce receiver if queue length is low or zero. Gracefully handles traffic spikes by never stressing out the backend.
Offline/BatchAllows taking the receiver offline for servicing or other reasons. Requests are buffered up until the receiver is available again.
Queue
![Page 35: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/35.jpg)
Queues
Load BalancingMultiple receivers compete for messages on the same queue (or subscription). Provides automatic load balancing of work to receivers volunteering for jobs.Observing the queue length allows to determine whether more receivers are required.
Queue
![Page 36: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/36.jpg)
TopicsTopic Sub
SubSub
Message DistributionEach receiver gets its own copy of each message. Subscriptions are independent. Allows for many independent ‘taps’ into a message stream. Subscriber can filter down by interest.
Constrained Message Distribution (Partitioning)Receiver get mutually exclusive slices of the message stream by creating appropriate filter expressions.
![Page 37: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/37.jpg)
Subscription FiltersFilter conditions operate on message properties and are expressed in SQL’92 syntax InvoiceTotal > 10000.00 OR ClientRating <3ShipDestCtry = ‘USA’ AND ShipDestState=‘WA’LastName LIKE ‘V%’
Filters actions may modify/add/remove properties as message is selectedSET AuditRequired = 1
![Page 38: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/38.jpg)
Runtime API Choices
HTTPREST
SOAP WS-*(Relay Clients)
![Page 39: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/39.jpg)
Messaging API Hello World!
var nsm = NamespaceManager.Create();nsm.CreateQueue("newQueue");
var client = QueueClient.Create("newQueue");client.Send(new BrokeredMessage { Properties = {{ "Greeting", "Hello World!" }}});
var m = client.Receive();Console.WriteLine(m.Properties["Greeting"]);
123
<appSettings> <add key="Microsoft.ServiceBus.ConnectionString" value="Endpoint=sb://[your namespace].servicebus.windows.net; SharedSecretIssuer=owner;SharedSecretValue=[your secret]" /></appSettings>
![Page 40: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/40.jpg)
Service Bus Messaging Samples
demo
![Page 41: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/41.jpg)
Tooling improvementsServer explorer Create queues/topicsExamine queue/topic propertiesSend test messageReceive message
Role template
![Page 42: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/42.jpg)
Service Bus Best PracticesClient object lifecycle management• Cache QueueClient, SubscriptionClient, TopicClient• Close clients when no longer needed. Close() method may throw an
exception. Wrap it with try/catch.
Handling transient errors• Implement consistent retry pattern• Consider Transient Fault Handling Framework
Reliable message handling (Peeklock)• Always finalize successfully processed message by calling Complete()• Always abandon unprocessed message by calling Abandon()• Ensure message is processed within designated lock period
![Page 43: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/43.jpg)
Service Bus Best Practices (cont.)Improve Performance• Reuse client objects• Choose Service Bus client protocol over HTTP• Use asynchronous send/receive• Use ReceiveAndDelete when appropriate• Client-side batching (asynchronous methods only)• Batching internal store access (EnableBatchedOperations = true)• Prefetching• Use multiple queues
![Page 44: Windows Azure Service Bus](https://reader033.vdocuments.site/reader033/viewer/2022042603/56813b61550346895da45cde/html5/thumbnails/44.jpg)
© 2011 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.