NServiceBus.AzureFunctions.ServiceBus - Public preview release available

Update: NServiceBus with Azure Functions has been released as 1.0 and is generally available. See NServiceBus.AzureFunctions.InProcess.ServiceBus 1.0.0 - Major release available for details.

Hi everyone,

We’ve just released a public preview version of NServiceBus.AzureFunctions.ServiceBus.

With NServiceBus.AzureFunctions.ServiceBus you can deploy your message handlers to the cloud as Azure Functions. The powerful NServiceBus programming model, combined with Azure Functions, makes it a breeze to build easy-to-deploy, scalable, pay-as-you-go distributed systems.

NServiceBus.AzureFunctions.ServiceBus allows Azure Functions to do the heavy lifting of deployment and runtime management, leaving you to focus on business functionality, while benefiting from all the usual NServiceBus features:

  • Full compatibility with NServiceBus endpoints
  • Immediate and delayed retries
  • Stateful message processing with NServiceBus Sagas
  • Auditing
  • Dependency injection support
  • Advanced pipeline extensibility
  • and more…

We’ve also released NServiceBus.AzureFunctions.StorageQueues, for using Azure Functions with Azure Storage Queues triggers.

Getting Started

NServiceBus.AzureFunctions.ServiceBus makes endpoint configuration super simple:

static readonly FunctionEndpoint endpoint = new FunctionEndpoint(_ => ServiceBusTriggeredEndpointConfiguration.FromAttributes());

[FunctionName("ASBTriggerQueue")]
public static async Task Run(
    [ServiceBusTrigger(queueName: "ASBTriggerQueue")]
    Message message,
    ILogger logger,
    ExecutionContext executionContext)
{
    await endpoint.Process(message, executionContext, logger);
}

With the configuration done, just add message handlers for any message type received by the function:

public class TriggerMessageHandler : IHandleMessages<TriggerMessage>
{
    private static readonly ILog Log = LogManager.GetLogger<TriggerMessageHandler>();

    public async Task Handle(TriggerMessage message, IMessageHandlerContext context)
    {
        Log.Info($"Handling {nameof(TriggerMessage)} in {nameof(TriggerMessageHandler)}");
        await context.SendLocal(new FollowupMessage());
    }
}

About the public preview

The NServiceBus.AzureFunctions.ServiceBus package is released as a public preview. Public previews are separately licensed, production-ready packages, aiming to react more quickly to customer’s needs. See the support policy for previews for more information about our support commitment. Preview packages may transition to fully supported versions after the preview period.

User adoption is crucial during this product development phase and helps us decide whether to make NServiceBus.AzureFunctions.ServiceBus a permanent part of the Particular Platform. Please let us know if you are using this preview by emailing us at support@particular.net.

We’d also love to receive your feedback about the new NServiceBus.AzureFunctions.ServiceBus package via our support channels, the project repository, or our public previews discussion group.

Where to get it

You can install the preview from NuGet.

With thanks,
The team in Particular

Please read our release policy for more details. Follow @ParticularNews to be notified of new releases and bug fixes.