Retirement of Service Bus Message Buffers service
Service Bus Buffers is an Azure service that was introduced in 2010 with the first wave of Azure. It is a volatile in memory communication buffer that was replaced by Queues and Topics which offer similar semantics on a much more feature rich platform with higher reliability.
Although required APIs to use Service Bus Buffers were deprecated in 2012 and removed from the Service Bus SDK in 2013 the service is being officially retired this year. The last SDK that supports Service Bus Buffers, v1.8, goes out of support on November 12 2015. As such we will be turning off the Service Bus Buffers service.
If you are currently using Service Bus Buffers, and very few customers are, please transition to Service Bus Queues. Service Bus Queues offer similar semantics, are much easier to use, and can be used in the Basic Tier plan at a cost of $0.05 per million operations, as opposed to $0.01 per 10,000 operations plus an hourly charge for Service Bus Buffers.
The code below shows using a Service Bus Buffer. As you can see it is not the easiest
string bufferAddress = "mynamespace.servicebus.windows.net/mybuffer";
string issuer = "owner";
string secret = "MY KEY";
MessageBufferClient bufferClient = null;
TransportClientEndpointBehavior credentials = new
TransportClientEndpointBehavior(
TokenProvider.CreateSharedSecretTokenProvider(issuer, secret));
try
{
bufferClient =
MessageBufferClient.GetMessageBuffer(credentials,
new Uri(bufferAddress));
bufferClient.GetPolicy();
}
catch (Exception ex)
{
MessageBufferPolicy policy = new MessageBufferPolicy();
policy.Discoverability = DiscoverabilityPolicy.Public;
policy.ExpiresAfter = TimeSpan.FromMinutes(10);
policy.MaxMessageCount = 50;
Uri address = new Uri(bufferAddress);
bufferClient = MessageBufferClient.CreateMessageBuffer(credentials, address, policy);
}
var msg = Message.CreateMessage(MessageVersion.Default, "POST", "Some Body");
bufferClient.Send(msg);
This code shows the equivalent with a Service Bus Queue.
string queueName = "Queue";
var nsm = NamespaceManager.CreateFromConnectionString("connectionstringtomyservicebusnamespace");
if(!nsm.QueueExists(queueName))
nsm.CreateQueue(new QueueDescription(queueName) {
AutoDeleteOnIdle = new TimeSpan(0, 10, 0), EnablePartitioning = false});
var qc = QueueClient.CreateFromConnectionString("");
qc.Send(new BrokeredMessage("Some Body"));
As can be seen Service Bus Queues offers a much easier construct to work with and also much more rich feature set.