Introduction to Windows Azure Service Bus Relay Service

3,371 views

Published on

Published in: Social Media, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
3,371
On SlideShare
0
From Embeds
0
Number of Embeds
13
Actions
Shares
0
Downloads
49
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Introduction to Windows Azure Service Bus Relay Service

  1. 1. • What is the ServiceBus • Relay Service © All Rights Reserved
  2. 2. © All Rights Reserved
  3. 3. • IPv4 is running out – Dynamic DNS – Network Address Translation (NAT) • Load Balancers • Routers • Hardware Firewall • Software Firewall * From MSDN Magazine • Web Services simply don’t work • What about calling back to the client? © All Rights Reserved
  4. 4. • People are doing it – Google Talk – Skype • Enters ServiceBus – Now, you can do it too • It’s not all about connectivity – Scalability – Availability – Security © All Rights Reserved
  5. 5. • Connect everything, anywhere – Kiosk – Mobile • Leverage existing SOA investments with cloud solutions • Not all apps move to the cloud • Names and organizes distributed endpoints • Provides simple registry • .NET and WCF integration – skills move forward – Open and accessible too • REST, SOAP, RSS, ATOM © All Rights Reserved
  6. 6. * From MSDN © All Rights Reserved
  7. 7. © All Rights Reserved
  8. 8. • Intermediary Pass-Through Service (Push) – Overcome connectivity challenges • Uses outbound connections only – Defaults to TCP with fallback to HTTP • Relays client calls to service • Hosted in the cloud – Scalability – Security * From MSDN – Management Portal © All Rights Reserved
  9. 9. • Service connects and authenticates against the relay – Relay determines how to communicate with the service • Client authenticates and calls the service – Relay forwards the message to the service * From MSDN Magazine © All Rights Reserved
  10. 10. • Enables – Connectivity – Tunneling – Eventing – Push • Supports – WS-* specifications – Message and transport security © All Rights Reserved
  11. 11. • Service Bus Address – [scheme]:[ns].servicebus.windows.net/{uri} – sb://MyCompany.servicebus.windows.net/CalcService • Service Bus Registry – ATOM-based feed of online services – http://MyCompany.servicebus.windows.net/ • Need to enable publishing to registry – Add ServiceRegsitrySettings endpoint behavior configured with public discovery type © All Rights Reserved
  12. 12. WCF Binding ServiceBus Binding BasicHttpBinding BasicHttpRelayBinding WebHttpBinding WebHttpRelayBinding WSHttpBinding WSHttpRelayBinding WS2007HttpBinding WS2007HttpRelayBinding WSHttpContextBinding WSHttpRelayContextBinding WS2007FederationHttpBinding WS2007FederationHttpRelayBinding NetTcpBinding NetTcpRelayBinding NetTcpContextBinding NetTcpRelayContextBinding N/A NetOnewayRelayBinding N/A NetEventRelayBinding © All Rights Reserved
  13. 13. • Connection Modes – Direct – Relayed – Hybrid • Requires additional setup of message security • Promotes to the most direct connection possible – Intranet / Machine • Supports duplex • Best performance and throughput • .NET parties only © All Rights Reserved
  14. 14. * From MSDN Magazine © All Rights Reserved
  15. 15. • One-way Relay Binding – – – – Messages are sent to a buffer No guarantee of order and delivery Disconnected scenarios (not a queue though!) One service can read off the queue (Unicast) • Event Relay Binding – Specialization of the one-way relay binding – Multiple services can read off the same queue • Notifications, Traces, Synchronization, … – Fan-out via single-sender-multi-receiver multicast – Fan-in via multi-sender-single-receiver unicast © All Rights Reserved
  16. 16. * From MSDN Magazine © All Rights Reserved
  17. 17. * From MSDN Magazine © All Rights Reserved
  18. 18. • Create the namespace and obtain the access key – Management Portal © All Rights Reserved
  19. 19. • Get the Windows Azure ServiceBus NuGet package var sh = new ServiceHost(typeof(ProblemSolver)); sh.AddServiceEndpoint( typeof (IProblemSolver), new NetTcpBinding(), "net.tcp://localhost:9358/solver"); sh.AddServiceEndpoint( typeof(IProblemSolver), new NetTcpRelayBinding(), ServiceBusEnvironment.CreateServiceUri("sb", "**namespace**", "solver")) .Behaviors.Add(new TransportClientEndpointBehavior { TokenProvider = TokenProvider.CreateSharedSecretTokenProvider( "owner", "**key**")}); sh.Open(); Console.WriteLine("Press ENTER to close"); Console.ReadLine(); sh.Close(); © All Rights Reserved
  20. 20. • Get the Windows Azure ServiceBus NuGet package var cf = new ChannelFactory<IProblemSolverChannel>( new NetTcpRelayBinding(), new EndpointAddress(ServiceBusEnvironment.CreateServiceUri( "sb", "**namespace**", "solver"))); cf.Endpoint.Behaviors.Add( new TransportClientEndpointBehavior { TokenProvider = TokenProvider.CreateSharedSecretTokenProvider("owner","**key**") }); using (var ch = cf.CreateChannel()) { Console.WriteLine(ch.AddNumbers(4, 5)); } © All Rights Reserved
  21. 21. © All Rights Reserved

×