![]() |
VOOZH | about |
dotnet add package CloudNimble.WebJobs.Extensions.Common --version 1.0.0-CI-20250608-015954
NuGet\Install-Package CloudNimble.WebJobs.Extensions.Common -Version 1.0.0-CI-20250608-015954
<PackageReference Include="CloudNimble.WebJobs.Extensions.Common" Version="1.0.0-CI-20250608-015954" />
<PackageVersion Include="CloudNimble.WebJobs.Extensions.Common" Version="1.0.0-CI-20250608-015954" />Directory.Packages.props
<PackageReference Include="CloudNimble.WebJobs.Extensions.Common" />Project file
paket add CloudNimble.WebJobs.Extensions.Common --version 1.0.0-CI-20250608-015954
#r "nuget: CloudNimble.WebJobs.Extensions.Common, 1.0.0-CI-20250608-015954"
#:package CloudNimble.WebJobs.Extensions.Common@1.0.0-CI-20250608-015954
#addin nuget:?package=CloudNimble.WebJobs.Extensions.Common&version=1.0.0-CI-20250608-015954&prereleaseInstall as a Cake Addin
#tool nuget:?package=CloudNimble.WebJobs.Extensions.Common&version=1.0.0-CI-20250608-015954&prereleaseInstall as a Cake Tool
CloudNimble.WebJobs.Extensions.Common provides a robust foundation for building cloud-agnostic Azure WebJobs extensions. This package contains base classes, interfaces, and utilities that enable you to create reliable, scalable queue processing solutions that work across different cloud providers.
dotnet add package CloudNimble.WebJobs.Extensions.Common
The library provides a complete queue processing pipeline:
// Custom queue processor with advanced error handling
public class MyQueueProcessor : QueueProcessor<MyMessage>
{
protected override async Task<bool> BeginProcessingMessageAsync(
MyMessage message,
CancellationToken cancellationToken)
{
try
{
// Your processing logic here
await ProcessBusinessLogic(message);
return true; // Message processed successfully
}
catch (TransientException)
{
return false; // Retry the message
}
}
protected override async Task CompleteProcessingMessageAsync(
MyMessage message,
FunctionResult result,
CancellationToken cancellationToken)
{
if (result.Succeeded)
{
// Clean up or audit successful processing
await LogSuccess(message);
}
}
}
Create custom converters for your message types:
public class CustomMessageConverter : IAsyncObjectToTypeConverter<IQueueMessage>
{
public async Task<ConversionResult<TOutput>> TryConvertAsync<TOutput>(
IQueueMessage input,
CancellationToken cancellationToken)
{
if (typeof(TOutput) == typeof(MyCustomType))
{
var json = await input.GetBodyAsync(cancellationToken);
var result = JsonSerializer.Deserialize<MyCustomType>(json);
return ConversionResult<TOutput>.Success((TOutput)(object)result);
}
return ConversionResult<TOutput>.Failure();
}
}
Implement custom backoff strategies for retry scenarios:
public class CustomDelayStrategy : IDelayStrategy
{
public TimeSpan GetNextDelay(bool executionSucceeded, TimeSpan currentDelay)
{
if (executionSucceeded)
{
return TimeSpan.Zero; // No delay on success
}
// Custom backoff logic
return TimeSpan.FromSeconds(Math.Min(currentDelay.TotalSeconds * 2, 300));
}
}
Implement queue metrics for autoscaling:
public class MyQueueMetricsProvider : IQueueMetricsProvider
{
public async Task<QueueProperties> GetQueuePropertiesAsync(
string queueName,
CancellationToken cancellationToken)
{
var messageCount = await GetMessageCountFromService(queueName);
return new QueueProperties
{
ApproximateMessagesCount = messageCount,
QueueLength = messageCount
};
}
}
The Common package integrates seamlessly with Azure WebJobs:
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
// Register your custom implementations
services.AddSingleton<IQueueProcessorFactory, DefaultQueueProcessorFactory>();
services.AddSingleton<IDelayStrategy, RandomizedExponentialBackoffStrategy>();
// Configure queue processing options
services.Configure<QueueProcessorOptions>(options =>
{
options.MaxDequeueCount = 5;
options.VisibilityTimeout = TimeSpan.FromMinutes(5);
options.MaxPollingInterval = TimeSpan.FromSeconds(30);
});
}
}
public class PoisonMessageHandler
{
public async Task HandlePoisonMessageAsync(PoisonMessageEventArgs args)
{
// Log the poison message
await LogPoisonMessage(args.Message, args.Exception);
// Move to dead letter queue
await MoveToDeadLetterQueue(args.Message);
// Send alert
await NotifyOperations(args);
}
}
Share context across different components:
public class RequestContextAccessor : ContextAccessor<RequestContext>
{
// Automatically provides thread-safe access to RequestContext
}
// Usage
services.AddScoped<IContextGetter<RequestContext>, RequestContextAccessor>();
services.AddScoped<IContextSetter<RequestContext>>(
provider => provider.GetService<RequestContextAccessor>());
We welcome contributions! Please see our Contributing Guide for details.
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ by CloudNimble
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on CloudNimble.WebJobs.Extensions.Common:
| Package | Downloads |
|---|---|
|
CloudNimble.WebJobs.Extensions.Amazon
Allows you to ren Azure WebJobs using AWS SQS triggers. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-CI-20250608-015954 | 290 | 6/8/2025 |
| 1.0.0-CI-20250608-013940 | 130 | 6/8/2025 |
| 1.0.0-CI-20250608-012213 | 126 | 6/8/2025 |
| 1.0.0-CI-20250606-232418 | 89 | 6/7/2025 |