What Is a Relay Service?

The solution for the Internet connectivity challenge is simple—since it is so difficult to connect the client to the service directly, avoid doing that (at least initially) and instead use a relay service. The relay service is a service residing in the cloud assisting in the connectivity, relaying the client calls to the service. Such a relay approach does require both the client and the service intranets to allow connecting to the cloud, but since the cloud constitutes neutral territory for both the client and the service, most environments, from consumer home machines to small intranets and large businesses, do allow calls out to the Internet, because that is perceived as an integral part of conducting business. A cloud-based relay service (as you will see later) also provides other benefits in terms of scalability, security, and administration.

Figure 11-2 shows how the relay service operates.

The service bus as a relay service

Figure 11-2. The service bus as a relay service

First, both the service and the client must establish connection against the relay service independently (steps 1 and 2 in Figure 11-2) and authenticate against the relay service. At this point, the relay also records where the service is and how to best call back to it. When the client calls the relay service (step 3), the relay service forwards the call (the client message) to the service (step 4).

The Windows Azure AppFabric ...

Get Programming WCF Services, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.