Microsoft ServiceBus .Net Client with SwiftMQ over AMQP 1.0

Introduction

This document explains how to use the Microsoft ServiceBus .Net Client with SwiftMQ and the AMQP 1.0 protocol.

Limitations of ServiceBus .Net Client

The client is designed to be used against ServiceBus. It uses it's own proprietary token-based authentication mechanism. It can only be used without SASL with a foreign AMQP 1.0 broker like SwiftMQ.

Download ServiceBus .Net Client

Download the client from here.

Disable SASL at SwiftMQ's AMQP Listener

SASL is enabled by default. Look at this page how you can disable it.

Code Sample

Following is a code sample that shows how a queue is used to send and receive a message. For further information please consult the corresponding docs from Microsoft. Note the URL which still uses the "sb" URI scheme where "myhost" is the hostname of the SwiftMQ Universal Router.

      var settings = new MessagingFactorySettings() { TransportType = TransportType.Amqp };
      settings.AmqpTransportSettings.UseSslStreamSecurity = false;
      MessagingFactory factory = MessagingFactory.Create("sb://myserver", settings);
      QueueClient qClient = factory.CreateQueueClient("q1");
      Console.WriteLine("Send a message to " + qClient.Path);
      qClient.Send(new BrokeredMessage("test"));
      var message = qClient.Receive();
      Console.WriteLine("Received a message. Body: " + message.GetBody<string>());
      message.Complete();
      factory.Close();