1 / 56

Windows Azure AppFabric Service Bus : New Capabilities

MID312. Windows Azure AppFabric Service Bus : New Capabilities. Clemens Vasters Principal Technical Lead Microsoft Corporation. The Cloud. All Apps Move To The Cloud. No They Don’t. Integrated Enterprise. Loyalty. Travel. Vendor Market. Health. Campaign. CRM. LOB. ERP. HR.

edna
Download Presentation

Windows Azure AppFabric Service Bus : New Capabilities

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MID312 Windows Azure AppFabric Service Bus: New Capabilities Clemens Vasters Principal Technical Lead Microsoft Corporation

  2. The Cloud.

  3. All Apps Move To The Cloud.

  4. No They Don’t.

  5. Integrated Enterprise Loyalty Travel Vendor Market Health Campaign CRM LOB ERP HR Time Card BI Shop BI Portal Benefits

  6. Very Few Go ‘All In’ On The Cloud. Sourced Vendor Market Firewall ? ? NAT Security Realm Loyalty Travel Health Campaign CRM LOB ERP HR Time Card BI Shop BI Portal Benefits

  7. So How Can This Work? Sourced Vendor Market Firewall ? ? NAT Security Realm Loyalty Travel Health • Existing Web Service Endpoint. • No Mutual Trust Between Systems, VPN not an option. • Sits Behind Firewall and NAT. • Not built for non-corporate identity access control Campaign CRM LOB ERP HR Time Card BI Shop BI Portal Benefits

  8. More Scenarios

  9. Connectivity Relay Service Bus Frontend Nodes Ctrl NLB 2 3 1 outbound socket rendezvous outbound socket connect Ctrl Forwarder Sender Receiver 4

  10. Connectivity Relay Service Bus Frontend Nodes • 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 Receiver

  11. So Far So Good.(“I’ve seen that already! What’s New?”)

  12. … in medias res …. Service Bus Commercially Available since January 2010 Brand-New Community Technology Preview Available Now

  13. We’re Adding a Whole New Set Of Capabilities Connectivity Service Relay Protocol Tunnel Eventing, Push Messaging Queuing Pub/Sub Reliable Transfer Service Management Naming, Discovery Monitoring Integration Routing Coordination Transformation ? Rich options for interconnecting apps across network boundaries Reliable, transaction-aware cloud messaging infrastructure for business apps. Consistent, modeling-friendly management surface and service virtualization capabilities Rich, declarative content-based routing, document transformation, and process coordination.

  14. Inventory and Fulfillment Centers ? Retail Points of Sale Real Time Retail Analytics Business Operations and Marketing

  15. Service Bus Store Inventory Queue

  16. Store Service Bus Store Inventory Queue Store Load Leveling Store

  17. Store Service Bus Store Inventory Queue Store Inventory Load Balancing Store

  18. Audit Service Bus Sub Store Inventory Data Collection Topic Sub Audit Taps

  19. Audit Service Bus Sub Store Inventory Data Collection Topic Sub Sub Dashboard Real-Time Observation

  20. Audit Service Bus Sub Store Inventory Data Collection Topic Sub Sub Sub MartVue Analyzer Analysis Topic Dashboard Sub Real-Time Analysis

  21. Audit Service Bus Sub Store Inventory Data Collection Topic Sub Sub Sub MartVue Analyzer Analysis Topic Dashboard Sub Catalog Topic Sub Scale-Out Eventing

  22. Queues! • Reliable, durable storage – up to 1GB per Queue* • Queues stay in the system once created, no TTL limit • Max message size 256KB, Sessions allow grouping • Messaging API, WCF, and HTTP/REST Interfaces P Queue C • *Limited to 100MB per Queue for CTP

  23. Why Queues? P Queue C Load Leveling Flatten spiky traffic into a predictable stream of work

  24. Why Queues? C P Queue C C Load Balancing C • Balance Work Across a Pool of Workers • Add and Remove Workers Based on Need (Queue Length)

  25. Why Queues? P Queue C Temporal Decoupling • Publish Work To Workers That Are Temporarily Offline • Enable Scheduled Batch Processing

  26. Why Queues? P Queue C Integrity • Don’t Lose Work If Errors Occur Before Processing Completes • Peek/Lock plus De-Dupe can often replace full Tx semantics

  27. Balancing Work With Queues ASP.NET Frontend Reply Queue Worker ASP.NET Frontend Reply Queue Worker ASP.NET Frontend Reply Queue Worker ASP.NET Frontend Reply Queue Worker ASP.NET Frontend Work Queue Worker • Can’t Stress Out The Backend • Frontend queries by correlation ID with timeout • Notifies user if timeout passes without response

  28. Topics! S C • All the Features of Queues + Publish/Subscribe • Up to 2000 Subscriptions on a Topic • Each Subscription is a virtual queue getting message copies • Subscriptions can have filters and actions P Topic S C S C

  29. Rules and Filters Subscription • Rules: • Rules select messages based on conditions • More than one rule for a subscription • Each matching rule yields copy of a message • Filter Conditions and Actions: • Condition represented by expressions • Actions can modify msg props during retrieval Rule Condition Action Rule Condition Action

  30. Filter Expressions Filter conditions operate on message properties and are expressed in SQL’92 syntax • InvoiceTotal > 10000.00 OR ClientRating <3 • ShipDestCtry = ‘USA’ AND ShipDestState=‘WA’ • LastNameLIKE ‘V%’ Filters actions may modify/add/remove properties as message is selected SET AuditRequired = 1

  31. Why Topics? C S C P Topic S C S C Event Fan Out C • Publish Events To Many Subscribers • Subscription Can Be Shared By Competing Consumers

  32. Why Topics? C P Topic S C S C Tap C • Primary Subscription Used Like a Queue • Secondary Subscription Used As Audit Tap

  33. Why Topics? C 0 < x < 33 S C P Topic S C 34 < x < 66 S C Partitioning 67 < x < 100 C • Filters applied to distribute messages to partitions • Mutually exclusive filters covering ranges

  34. “Ok, I Get It”Code? Code!

  35. Creating Things on The Namespace ServiceBusNamespaceClientnamespaceClient = newServiceBusNamespaceClient(baseAddress, TransportClientCredentialBase.CreateSharedSecretCredential(acc, key)); // Create a queue with default settings namespaceClient.CreateQueue("DefaultQueue"); // Create a queue with custom settings QueueDescriptionqd = newQueueDescription(); qd.DefaultMessageTimeToLive= newTimeSpan(1, 0, 0); qd.EnableDeadLetteringOnMessageExpiration= true; namespaceClient.CreateQueue("CustomQueue", qd); // Delete entities namespaceClient.DeleteQueue("DefaultQueue");

  36. The Service Bus Namespace Client • Management operations are performed using the ServiceBusNamespaceClient • CreateTopic, GetTopic, DeleteTopic • CreateQueue, GetQueue, DeleteQueue • Yields Queue and Topic instances • Provide access to metadata and settings • Takes QueueDescription and TopicDescription instances • Inputs for CreateTopic/Queue ServiceBusNamespaceClient clemens.servicebus.appfabriclabs.com / create delete Q T

  37. Runtime API Choices Apps HTTPREST SOAP WS-*(Relay Clients) WCF Service Model Messaging API WCF Bindings Service Bus Relay Protocol Implementation(private) .NET Framework 4.0 Any Platform Service Bus

  38. The Messaging API Messaging-Specific API That Provides Access To All Features HTTPREST SOAP WS-*(Relay Clients) WCF Service Model Messaging API WCF Bindings Service Bus Relay Protocol Implementation(private) .NET Framework 4.0 Any Platform

  39. MessagingFactory MessagingFactory Connection Manager (private) • Clients for sending/receiving messages are created via MessagingFactory • Factory creates entity-specific “client” • QueueClient, TopicClient, SubscriptionClient • Clients create send and receive objects • MessageSender, MessageReceiver, SessionReceiver • Provides an abstraction that allows client send/receive code to be written to Queues, Topics, and Subscription in an identical fashion. QueueClient SubscriptionClient TopicClient MessageSender MessageReceiver SessionReceiver

  40. Sending Messages // Send a message with system and application properties set BrokeredMessagebm = BrokeredMessage.CreateMessage(); bm.Label = "PurchaseOrder123"; bm.TimeToLive = newTimeSpan(0, 5, 0); bm.Properties["PurchaseOrderID"] = 1234; ms.Send(bm); MessagingFactoryfactory = MessagingFactory. Create(baseAddress, factorySettings); QueueClientqueueClient = factory.CreateQueueClient("DefaultQueue"); // Create a MessageSender MessageSenderms = queueClient.CreateSender(); // Send a message with a String body ms.Send(BrokeredMessage.CreateMessage("Test message"));

  41. Receiving Messages // Create a MessageReceiver with PeekLock semantics MessageReceiver mr2 = queueClient.CreateReceiver(ReceiveMode.PeekLock); BrokeredMessage rm2 M= mr.Receive(); try { // ProcessMessage(rm2); rm2.Complete(); } catch (Exception e) { rm2.Abandon(); } // Create a MessageReceiver with ReceiveAndDeletesemantics MessageReceivermr = queueClient.CreateReceiver(ReceiveMode.ReceiveAndDelete); BrokeredMessagerm = mr.Receive();

  42. Sessions // Create a SessionReceiver to get next available session SessionReceiversr = queueClient.AcceptSessionReceiver(ReceiveMode.PeekLock); BrokeredMessagerm3 = sr.Receive(); try { ProcessMessage(rm3); sr.Session.SetState(bytes); rm3.Complete(); } catch(Exception) { rm3.Abandon(); }

  43. Topic MessagingFactoryfactory = MessagingFactory.Create(baseAddress, factorySettings); // Create a TopicClient TopicClienttopicClient = factory.CreateTopicClient("DefaultTopic"); // Create a MessageSender MessageSenderms = topicClient.CreateSender(); // Send a message with a String body ms.Send(BrokeredMessage.CreateMessage("Test message")); // Create a SubscriptionClient SubscriptionClientsubscriptionClient=factory.CreateSubscriptionClient("DefaultTopic/MySubscription"); // Create a MessageReceiver MessageReceivermr = subscriptionClient.CreateReceiver(ReceiveMode.ReceiveAndDelete); BrokeredMessagerm = mr.Receive();

  44. Subscription Filter Rules // Create a topic and 3 subscriptions. Topic topic = namespaceClient.CreateTopic(Program.TopicName); // Create a subscription for all messages sent to topic. topic.AddSubscription(SubsNameAllMessages, newMatchAllFilterExpression()); // Create a subscription that'll receive all messages with // color property with value "blue" and brushSize with value 10. stringfilterExpression = "color = 'blue' AND brushSize = 10"; topic.AddSubscription(SubsNameFilteredMessages, newSqlFilterExpression("color = 'blue' AND brushSize = 10")); // Create a subscription that'll receive all messages which have CorrelationId set to foo topic.AddSubscription(SubsNameCorrelatedMessages, newCorrelationFilterExpression("foo"));

  45. Subscription Filter Actions //Create a topic myTopic= namespaceClient.CreateTopic("IssueTrackingTopic"); // Create a Rule that stamps Importance property value 'Low' RuleDescriptiondefaultPriRuleDescription= newRuleDescription(); defaultPriRuleDescription.FilterAction= newSqlFilterAction("set Importance = 'Low';"); // Create a Rule that selectively stamps Priority and Importance values RuleDescriptionhighPriRuleDescription= newRuleDescription(); highPriRuleDescription.FilterExpression = newSqlFilterExpression("SupportPackage = 'Premium' OR Severity <= 1"); highPriRuleDescription.FilterAction= newSqlFilterAction("set Priority = 1;set Importance = 'High';"); // Create a Subscription and apply rules SubscriptionmySub= myTopic.AddSubscription("IssueTrackingSubscription", defaultPriRuleDescription); mySub.AddRule("High Priority", highPriorityRuleDescription);

  46. WCF ServiceBusMessagingBinding Convenient, Familiar Experience For Many Apps HTTPREST SOAP WS-*(Relay Clients) WCF Service Model Messaging API WCF Bindings Service Bus Relay Protocol Implementation(private) .NET Framework 4.0 Any Platform

  47. WCF Experience • ServiceBusMessagingBinding • One-Way Messaging • Automatic Pump – Pull/Push Translation • IInputChannel, IOutputChannel, IInputSessionChannel • Transport-Level Security • ServiceBusMessagingFactorySettings available for tweaking as binding properties • BrokeredMessage available as a message property of the WCF message on receive Application / Dispatcher Service Bus Transport Channel .Net API SOAP over SBMP

  48. Summary • AppFabric is the New Middle-Tier • Building Blocks for Building Real Apps • Service Bus is the enabler for ‘hybrid apps’ • Connectivity and Reliable Messaging • Very rich new Publish/Subscribe Capabilities • CTP Available Now

  49. Required Slide Speakers, please list the Breakout Sessions, Interactive Discussions, Labs, Demo Stations and Certification Exam that relate to your session. Also indicate when they can find you staffing in the TLC. Related Content • COS311 - Introduction to Windows Azure AppFabric Composite Applications • MID271-INT - Futures: Integration Capabilities in Windows AppFabricMID373-INT - Accessing Enterprise Data from the Cloud and Mobile Devices Using Microsoft BizTalk Server and Windows Azure AppFabric

  50. Required Slide Track PMs will supply the content for this slide, which will be inserted during the final scrub. Track Resources • http://www.microsoft.com/windowsazure/appfabric/overview/ • https://portal.appfabriclabs.com

More Related