All Projects → Scooletz → QueueBatch

Scooletz / QueueBatch

Licence: Apache-2.0 license
WebJobs/Azure Functions trigger providing batches of Azure Storage Queues messages directly to your function

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to QueueBatch

nodejs-postgresql-azure
Repositório responsável pela série de artigos sobre Node.js com PostgreSQL
Stars: ✭ 70 (+75%)
Mutual labels:  azure-functions, azure-storage
movie-db-java-on-azure
Sample movie database app built using Java on Azure
Stars: ✭ 28 (-30%)
Mutual labels:  azure-functions, azure-storage
Serverless-File-Validation
Using Azure Serverless products to perform file validation on a per-batch basis
Stars: ✭ 21 (-47.5%)
Mutual labels:  azure-functions, azure-storage
azure-developer-college
Repository for the Azure Developer College Workshop
Stars: ✭ 16 (-60%)
Mutual labels:  azure-functions, azure-storage
Azure For Developers Workshop
The Azure cloud is huge and the vast service catalog may appear daunting at first, but it doesn’t have to be!
Stars: ✭ 38 (-5%)
Mutual labels:  azure-functions, azure-storage
durable-functions-producer-consumer
Uses Durable Functions' fan out pattern to load N messages across M sessions into various Azure Storage/Messaging services. Includes the ability to consume the messages with another Azure Function & load timing data in to Event Hubs for ingestion in to analytics services like Azure Data Explorer
Stars: ✭ 31 (-22.5%)
Mutual labels:  azure-functions, azure-storage
fl-image-resize
A library to quickly resize images with Azure Functions
Stars: ✭ 15 (-62.5%)
Mutual labels:  azure-functions, azure-storage
Serverless Url Shortener
Azure Function for a URL shortening website. Uses serverless functions, Azure Table Storage and Application Insights.
Stars: ✭ 113 (+182.5%)
Mutual labels:  azure-functions, azure-storage
Azure Readiness Checklist
This checklist is your guide to the best practices for deploying secure, scalable, and highly available infrastructure in Azure. Before you go live, go through each item, and make sure you haven't missed anything important!
Stars: ✭ 457 (+1042.5%)
Mutual labels:  azure-functions, azure-storage
Serverless Microservices Reference Architecture
This reference architecture walks you through the decision-making process involved in designing, developing, and delivering a serverless application using a microservices architecture through hands-on instructions for configuring and deploying all of the architecture's components along the way. The goal is to provide practical hands-on experience in working with several Azure services and the technologies that effectively use them in a cohesive and unified way to build a serverless-based microservices architecture.
Stars: ✭ 270 (+575%)
Mutual labels:  azure-functions, azure-storage
Developing Solutions Azure Exam
This repository contains resources for the Exam AZ-203: Developing Solutions for Microsoft Azure. You can find direct links to resources and and practice resources to test yourself ☁️🎓📚
Stars: ✭ 59 (+47.5%)
Mutual labels:  azure-functions, azure-storage
media-services-v3-dotnet-core-functions-integration
The project includes several folders of sample Azure Functions for use with Azure Media Services v3 that show workflows related to ingesting content, encoding, publishing or live stream management.
Stars: ✭ 41 (+2.5%)
Mutual labels:  azure-functions, azure-storage
AzureStorageTypeProvider
An F# Azure Type Provider which can be used to explore Blob, Table and Queue Azure Storage assets and easily apply CRUD operations on them.
Stars: ✭ 82 (+105%)
Mutual labels:  azure-storage
azure-sql-db-change-stream-debezium
SQL Server Change Stream sample using Debezium
Stars: ✭ 74 (+85%)
Mutual labels:  azure-functions
identityazuretable
This project provides a high performance cloud solution for ASP.NET Identity Core using Azure Table storage replacing the Entity Framework / MSSQL provider.
Stars: ✭ 97 (+142.5%)
Mutual labels:  azure-storage
azure-functions-python-library
Azure Functions Python SDK
Stars: ✭ 95 (+137.5%)
Mutual labels:  azure-functions
shorty
URL shortener available as library, microservice (even containerized), aws lambda, and azure function
Stars: ✭ 31 (-22.5%)
Mutual labels:  azure-functions
OSCI
Open Source Contributor Index
Stars: ✭ 107 (+167.5%)
Mutual labels:  azure-functions
serverlessnotifications
Serverless notifications with Azure Cosmos DB + Azure Functions + Azure SignalR
Stars: ✭ 60 (+50%)
Mutual labels:  azure-functions
serverless-multicloud-example
An example Node Express app that can be deployed in any major cloud by the Serverless framework
Stars: ✭ 20 (-50%)
Mutual labels:  azure-functions

Build Status

Icon

QueueBatch

QueueBatch is an Azure Functions trigger providing ability to process Azure Storage Queue messages in batches.

Why?

Azure Functions trigger for Azure Storage Queue obtains messages in batches but dispatches them in separate tasks. It's ok, if a function touches different resources. If a function does some processing and then appends to a single append blob it won't scale up nicely. The problems that might occur are:

  • issuing many IO transactions,
  • failing due to concurrency checks (hot resources)
  • breaching throughput of a partition, etc.

Accessing the same resource with high frequency might simply not work. With QueueBatch, you can address it, by processing all the messages from the batch in the same function, amortizing the cost of accessing other resources.

Usage

Basic

To use QueueBatch in your Function application, you need to use a custom IMessageBatch parameter type to accept a batch and mark it with an appropriate attribute. To resolve queue name from configuration file wrap it with % sign, i.e. %queue-app-setting-key%

public static void MyFunc([QueueBatchTrigger("myqueue")] IMessageBatch batch)
{
  foreach (var msg in batch.Messages)
  {
    // do something with payload
    DoSomething(msg.Payload);
  }

  // acknowledge processing
  batch.MarkAllAsProcessed ();
}

With SuccessOrFailAsBatch set to false, you can also acknowledge only some of the messages. The rest, will be retried in a similar manner to the regural [QueueTrigger]

public static void MyFunc([QueueBatchTrigger("myqueue", SuccessOrFailAsBatch = false)] IMessageBatch batch)
{
  foreach (var msg in batch.Messages)
  {
    // do something with payload
    if (DoSomething(msg.Payload))
    {
       // mark as processed only if successful
       batch.MarkAsProcessed (msg);
    }
  }
}

Faster queues

QueueBatch provides an alternative client for accessing Azure Storage Queues that is much faster then the one provided by SDK (up to 20x). To enable it (it's opt-in), you need to set UseFasterQueues to true.

public static void MyFunc([QueueBatchTrigger("myqueue", UseFasterQueues = true)] IMessageBatch batch)
{
  // ...
}

Parallel gets

As a single operation of getting messages can obtain no more than 32, you can request issuing multiple parallel gets. The maximum number of messages in a batch will be equal to 32 * ParallelGets.

public static void MyFunc([QueueBatchTrigger("myqueue", ParallelGets = 2)] IMessageBatch batch)
{
  // ...
}

Empty batches

Sometimes it might be useful to get notifications about empty batches as well. They can be used to do some other work, like compacting your data or sending a notification that there was a run with nothing to process. After each empty batch, the back-off strategy will delay the next query for messages even more. To enable calls with empty batches, specify the following property

public static void MyFunc([QueueBatchTrigger("myqueue", RunWithEmptyBatch = true)] IMessageBatch batch)
{
  // now, if no message is retrieved from the queue, MyFunc will still be called
}

Connection

Connection is an optional property to specify queue's storage account. It's a name of an app setting that contains the storage connection string to use for this binding. When connection property is empty then default AzureWebJobsStorage connection string is used.

public static void MyFunc([QueueBatchTrigger("myqueue", Connection = "StorageConnectionAppSetting")] IMessageBatch batch)
{
  // ...
}

Licensing

QueueBatch

QueueBatch is licensed under the Apache License 2.0 license.

Azure Webjobs SDK

Azure Webjobs SDK is licensed under the MIT license as described here. Azure Webjobs SDK sources are used and partially compiled into the QueueBatch distribution as allowed under the license terms found here.

Icon

Batch Download designed by Fatahillah from The Noun Project

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].