1 / 41

Driving the Azure Service Bus

Driving the Azure Service Bus. Scott Klueppel Solutions Architect SOAlutions , Inc. # jaxcodeimpact @ kloopdogg. Azure Service Bus. Agenda. - Feature Overview - Management Portal / Tools - Relayed vs. Brokered Messaging - Cloud Design Patterns

joelle
Télécharger la présentation

Driving the Azure Service Bus

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. Driving theAzure Service Bus Scott Klueppel Solutions Architect SOAlutions, Inc. #jaxcodeimpact @kloopdogg

  2. Azure Service Bus Agenda • - Feature Overview • - Management Portal / Tools • - Relayed vs. Brokered Messaging • - Cloud Design Patterns • - Building Hybrid/Cross-Platform Systems

  3. Azure Service Bus Feature Overview Management Portal Tools

  4. What is the Service Bus? Azure Service Bus • - Cross-platform middleware • - Unified set of messaging capabilities • - Request/Response • - One-way • - Queued • - Publish/Subscribe

  5. Windows Azure SDK Azure Service Bus • - SDK contains client libraries • - MS Committed to backwards compatibility

  6. Demo Management Portal Tools

  7. Relayed Messaging Features Demo

  8. What is a relay? Relays • A centralized service that offers connectivity options for clients and servers communicating in challenging network scenarios • Permits one-way, request/response messaging • Supports SOAP, WS-*, optimized for WCF • Service hosts are “Listeners” • Clients only call the relay service

  9. How does it work? Relays 7 Relay message (load balancing) Service Bus 8 Deliver message Access Control Service 3 Open RelayConnection Send message 6 On-Premise 2 Return Token Return Token 5 WCF Service Remote 1 4 Client SendShared Secret SendShared Secret

  10. Scenario 1: Network Infrastructure Relays On-Premise Relay Corporate Web App WCF Service Firewall NAT Client Firewall NAT Other Service Dynamic IPs No LB/ACE

  11. Scenario 2: Emergency Use Relays On-Premise Relay Corporate Web App WCF Service Firewall NAT Client Other Service Firewall NAT WCF Service

  12. Scenario 3: Roaming Devices Relays On-Premise Corporate . Web App WCF Service Client Firewall NAT Other Service Firewall NAT Relay Coffee Shop . Client

  13. Considerations Relays • If there are no listeners, the service is unavailable • No automatic scaling for high bursts of traffic • Load balancing is not configurable • Ports 9350-9353 (outbound only)

  14. Demo Convert to Relay Load balancing

  15. Brokered Messaging Features Demos

  16. What is brokered messaging? • Sender makes asynchronous calls • Messages are durably stored in a broker • Broker holds messages until receiver is available • Ideal for distributed or occasionally-connected systems • Service Bus offers queues and topics … and soon event hubs

  17. Queues Queues • Messages are durably stored until consumed • Messages pulled from queue by one or more competing consumers • Benefits: - Temporal decoupling - Load leveling - Load balancing

  18. Topics (and Subscriptions) Topics • Messages are durably stored until consumed • Messages are sent to one or more subscriptions - Messages pulled from subscriptions by one or more competing consumers • Benefits: - Temporal decoupling - Load leveling - Load balancing

  19. Show me the messages Queue Topic Queues Topics (with subscriptions) Client Service Service Service Sub {color=red} Client Sub {true}

  20. Creating broker objects Queues namespaceManager.CreateQueue("issues"); Topics namespaceManager.CreateTopic("telemetry-ingestion"); Subscriptions namespaceManager.CreateSubscription("telemetry-ingestion", // topic name"Dashboard", // subscription name new SqlFilter("Color = 'red'")); // filter (optional)

  21. The BrokeredMessage class • Body (object or stream) • Properties (KVP) • Has two primary constructors: BrokeredMessage() - Empty body BrokeredMessage(object) - Object must be serializable (uses DataContractSerializer)

  22. Receiving Brokered Messages • Poll using “Receive” operations (client API) • Use messaging bindings with a WCF service

  23. Using queues Queues • Create a queue client • Send a message • Receive a message varuri = ServiceBusEnvironment.CreateServiceUri("sb", namespace, String.Empty); TokenProvider credentials = TokenProvider.CreateSharedSecretTokenProvider(IssuerName, IssuerKey); MessagingFactoryfactory = MessagingFactory.Create(uri, credentials); QueueClientqueueClient= factory.CreateQueueClient("TestQueue"); TimeSpanreceiveTimeout= TimeSpan.FromSeconds(5); while((message = queueClient.Receive(receiveTimeout)) != null) { //TODO: Do work message.Complete(); } BrokeredMessageissueMsg = new BrokeredMessage(issue); queueClient.Send(issueMsg);

  24. Using topics Topics • Send a message • Receive a message MessagingFactoryfactory = MessagingFactory.Create(uri, credentials); SubscriptionClientsubscriptionClient = factory.CreateSubscriptionClient(topicName, subscriptionName); TimeSpanreceiveTimeout = TimeSpan.FromSeconds(5); while((message = subscriptionClient.Receive(receiveTimeout)) != null) { //TODO: Do work message.Complete(); } MessagingFactoryfactory = MessagingFactory.Create(uri, credentials); TopicClienttopicClient= factory.CreateTopicClient(topicName); BrokeredMessageissueMsg = new BrokeredMessage(issue); topicClient.Send(issueMsg);

  25. Auto-forwarding Scale out for more overall subscriptions • Auto-forwarding topics and queues - Improves overall performance Fan in from several queues Forward to (maybe delayed) processing queues Topic Client Queue Queue Subscription Topic Topic Subscription Subscription Client Topic Auto-forwarding Auto-forwarding Queue Client Subscription Queue Subscription Client Auto-forwarding Topic Subscription Subscription Queue Subscription Subscription Queue Client Topic Subscription Subscription Subscription

  26. Squeezing Performance • Use SBMP over HTTP • Reuse clients → fewer connections • Client-side batching (async only) • Express queues/topics • Partitioning → distributed internal store

  27. Demo Queues Topics

  28. Patterns at Work Queue-Based Load Leveling Priority Queues

  29. Queue-Based Load Leveling • Maximize availability • Increased scalability • Control costs

  30. Priority Queue • Prioritization ofmessage processing • Maximizeperformance • Minimize operationalcosts

  31. Cross-Platform AMQP Devices

  32. Azure Service Bus Multiple Protocol Support Service Bus Protocols - SBMP • High performance • .NET/Windows only - HTTP • Lower performance • High reach - AMQP • High performance • High reach

  33. Azure Service Bus AMQP • Enables cross-platform systems to be built using brokers and frameworks from different vendors • Open, standard messaging protocol - OASIS AMQP 1.0 Standard (in progress since 2008, completed in 2013) • Service Bus .NET Client Library (C#) • Apache Qpid JMS/IIT SwiftMQ (Java) • Apache Qpid Proton (C, PHP, Python)

  34. Azure Service Bus Use Case: Sensors/Devices AMQP Ingestion / Analysis Coordinator • ZigBee Radio • Solar Cell(s) • Batteries • Sensors • Temperature • Moisture • Light • Sound

  35. Azure Service Bus Event Hubs (Preview) • Facilitates cloud-scale ingestion - Telemetry data - Events • Millions of events per second (up to 1 GB/s) • Support for AMQP and HTTP • Each partition - 1MB/s ingress and 2MB/s egress - Needs exactly one dedicated worker process

  36. Demo AMQP Linux/Python

  37. What did we talk about? Azure Service Bus Features Some cloud design patterns Cross-platform goodness

  38. code.org Programming for any age

  39. Questions? Scott Klueppel Solutions Architect SOAlutions, Inc. #jaxcodeimpact @kloopdogg

  40. References Cloud Design Patterns (P&P)http://msdn.microsoft.com/en-us/library/dn568099.aspx Apache Qpid Protonhttp://qpid.apache.org/proton/

  41. Thank you! Scott Klueppel Solutions Architect SOAlutions, Inc. #jaxcodeimpact @kloopdogg

More Related