More Related Content
Similar to Introduction to Windows Azure Service Bus Relay Service
Similar to Introduction to Windows Azure Service Bus Relay Service (20)
More from Tamir Dresher (20)
Introduction to Windows Azure Service Bus Relay Service
- 2. • What is the ServiceBus
• Relay Service
© All Rights Reserved
- 4. • 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
- 5. • 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
- 6. • 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
- 9. • 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
- 10. • 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
- 11. • Enables
– Connectivity
– Tunneling
– Eventing
– Push
• Supports
– WS-* specifications
– Message and transport security
© All Rights Reserved
- 12. • 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
- 14. • 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
- 16. • 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
- 19. • Create the namespace and obtain the access key
– Management Portal
© All Rights Reserved
- 20. • 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
- 21. • 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