Skip to content
Inspired by the simple EasyNetQ API, this library helps you get started with Microsoft Azure Service Bus or Service Bus 1.1 for Windows Server pub/sub and queues!
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore Updated dependencies and added support for AutoRenewTimeout Aug 27, 2017
LICENSE Initial commit Feb 10, 2014
README.md Update README.md Jun 27, 2016

README.md

Build status

AzureBus

Inspired by the simple EasyNetQ API, this library helps you get started with Microsoft Azure Service Bus or Service Bus 1.1 for Windows Server pub/sub and queues!

using AzureBus;

// Create a bus instance
IBus bus = AzureCloud.CreateBus();

// Publish a sample message.
bus.Publish(new SampleMessage("message value"));

// Sample consumer class
public class Consumer : IConsume<SampleMessage>
{
    public void Consume(SampleMessage message)
    {
        Console.WriteLine(string.Format("Message received: Value = {0}", message.Value));
    }
}

// Subscribe to messages using consumers in an assembly.
var autoSubscriber = new AutoSubscriber(bus, "subscriptionId");
autoSubscriber.Subscribe(Assembly.GetExecutingAssembly());

Queues are also supported:

// Create a Queue instance
IQueue queue = AzureCloud.CreateQueue();

// Subscribe to queue for messages of type SampleMessage
queue.Subscribe<SampleMessage>((m) => Console.WriteLine(m.Value));

// Send message.
queue.Send(new SampleMessage("message value"));

AzureBus is available as nuget package.

To install AzureBus, run the following command in the Package Manager Console

PM> Install-Package AzureBus
You can’t perform that action at this time.