Isoftforge.Apps.Client.Queue
1.0.0
See the version list below for details.
dotnet add package Isoftforge.Apps.Client.Queue --version 1.0.0
NuGet\Install-Package Isoftforge.Apps.Client.Queue -Version 1.0.0
<PackageReference Include="Isoftforge.Apps.Client.Queue" Version="1.0.0" />
<PackageVersion Include="Isoftforge.Apps.Client.Queue" Version="1.0.0" />
<PackageReference Include="Isoftforge.Apps.Client.Queue" />
paket add Isoftforge.Apps.Client.Queue --version 1.0.0
#r "nuget: Isoftforge.Apps.Client.Queue, 1.0.0"
#:package Isoftforge.Apps.Client.Queue@1.0.0
#addin nuget:?package=Isoftforge.Apps.Client.Queue&version=1.0.0
#tool nuget:?package=Isoftforge.Apps.Client.Queue&version=1.0.0
Isoftforge.Apps.Client.Queue
.NET client for the isoftforge Queue satellite API. Publish and consume messages over HTTP using only a base URL and an API key — no broker host, port or extra environment configuration required.
Configuration
var client = QueueClient.Create(
baseUrl: "https://apps-api.isoftforge.it/api/queue",
apiKey: "ifc_your-api-key");
Or with dependency injection:
services.AddQueueClient(configuration.GetSection("Queue"));
{
"Queue": {
"BaseUrl": "https://apps-api.isoftforge.it/api/queue",
"ApiKey": "ifc_your-api-key"
}
}
- BaseUrl — hub proxy
https://apps-api.isoftforge.it/api/queueor dedicated hosthttps://queue-api.isoftforge.it/api - ApiKey — organization credential from Queue → Credentials (header
X-API-Key)
The API key identifies your organization and resolves the queue environment automatically, so only the URL and API key are needed.
Publish
await client.PublishAsync("orders", "{ \"id\": 123 }");
await client.PublishAsync(new PublishRequest
{
QueueName = "orders",
Body = "{ \"id\": 123 }",
ContentType = "application/json"
});
Consume (pull once)
var messages = await client.ConsumeAsync("orders", new ConsumeOptions { MaxMessages = 10 });
foreach (var message in messages)
{
Console.WriteLine(message.Body);
await client.AckAsync(message.DeliveryTag); // confirm
// or: await client.NackAsync(message.DeliveryTag, requeue: true);
}
Consume (continuous consumer)
ConsumeLoopAsync polls the queue and calls your handler for each message. It acknowledges automatically after the handler succeeds and nacks (requeues) when it throws. It runs until the cancellation token is cancelled.
var cts = new CancellationTokenSource();
await client.ConsumeLoopAsync("orders", async (message, ct) =>
{
await ProcessAsync(message.Body, ct);
}, new ConsumeLoopOptions
{
MaxMessages = 20,
PollInterval = TimeSpan.FromSeconds(2),
RequeueOnError = true
}, cts.Token);
Run it as a hosted background service:
public sealed class OrdersConsumer : BackgroundService
{
private readonly IQueueClient _queue;
public OrdersConsumer(IQueueClient queue) => _queue = queue;
protected override Task ExecuteAsync(CancellationToken stoppingToken) =>
_queue.ConsumeLoopAsync("orders", HandleAsync, new ConsumeLoopOptions(), stoppingToken);
private async Task HandleAsync(QueueMessage message, CancellationToken ct)
{
// process message.Body
}
}
Queue management
var queues = await client.ListQueuesAsync();
await client.CreateQueueAsync(new CreateQueueRequest { Name = "orders", Durable = true });
Validation
var validation = await client.ValidateCredentialsAsync();
if (!validation.Valid) throw new InvalidOperationException(validation.Error);
API surface
IQueueClient—ValidateCredentialsAsync,ListQueuesAsync,CreateQueueAsync,PublishAsync,ConsumeAsync,AckAsync,NackAsync,ConsumeLoopAsyncQueueClientException— thrown on HTTP errors; includesStatusCodeand the API error code when available
Consuming happens over HTTP (polling). For high-throughput streaming you can still connect any AMQP 0-9-1 client to the broker on port 5672.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Http (>= 10.0.8)
- Microsoft.Extensions.Options (>= 10.0.8)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.8)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.