Service Bus NetTcpRelayBinding

Posted: March 17, 2013 in WCF, Windows Azure

This is one of the first binding of the Windows Azure Service bus. I previously introduced the Windows Azure Relay Binding with a small introduction about each binding. In this post you will be able to understand better how the NetTcpRelayBinding Namespace work. The NetTcpRelayBinding is similar to the NetTcpBinding.

This type of binding the NetTcpRelayBinding supports three types of connection modes, whether hybrid, Relay or Direct. Let’s talk first about the process then we can talk on the differences.

Usually the service registers itself in the service bus, the clients too register themselves in the service bus. Certainly these things are done programmatically. After that the processes differ depending on the connection mode. If the connection mode is a Relay connection then all the next processes go through the service itself, if the connection mode is a direct then a direct connection between the client and the service is established without passing by the service bus. For the Hybrid connection mode, the connection mode starts as relay and then see if the direct connection is feasible to be done or not, if yes then it will change to direct if not then it will remain relay.

Depending on the connection mode, you will then have to decide if the message security is needed or not yet. Which mean if you are using relay connection mode, you won’t need to work on the security message because the connection will always go through the service itself but otherwise when the clients connect automatically or in a hybrid way, you will certainly need to work on the Message security.

The NetTcpRelayBinding is a faster way of communication than the other way of Bindings like the WSHttpRelayBinding.

For more information about securing the Service Bus using the .Net, you will find all the details in the following blog post.

For the clients, services and any other different service bus user using the NetTcpRelayClient, you have to know that the URI scheme must be “sb”. All what is related to the binding, security and endpoints can be found in the application configuration file. It looks like the following:

<endpoint name=”RelayEndpoint”

contract=”Microsoft.ServiceBus.Samples.IMyContract”

binding=”netTcpRelayBinding”

bindingConfiguration=”default”

behaviorConfiguration=”ReplaceWithEndpointBehaviorName”

address=”ReplaceWithEndpointAddress” />

If you are working with the NetTcpRelayBinding, you have to make sure that both the sender and the receiver or all the service clients have the same bindings because other ways they won’t be able to communicate to each other for simple reason that the NetTcpRelayBinding is not interoperable.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s