Alton 1.1.0
dotnet add package Alton --version 1.1.0
NuGet\Install-Package Alton -Version 1.1.0
<PackageReference Include="Alton" Version="1.1.0" />
paket add Alton --version 1.1.0
#r "nuget: Alton, 1.1.0"
// Install Alton as a Cake Addin
#addin nuget:?package=Alton&version=1.1.0
// Install Alton as a Cake Tool
#tool nuget:?package=Alton&version=1.1.0
Alton
1. Introduction
Alton is a piece of middleware which will provide APIs to help manage your queues via your ops portal.
2. How to use
Alton is an ASP.NET Core piece of middleware that will automatically register routes on your behalf. Alton is still in a preview stage and some issues may arise.
Firstly, to register the middleware, you will need to add it to the service collection and register the middleware:
Registering Alton
public void ConfigureServices(IServiceCollection services)
{
services.AddAlton();
//my other services here
}
The IServiceCollection.AddAlton()
extension will automatically register an SqsClientResolver
which will create an SQS client using the region parsed from the QueueUrl.
You can provide your own resolver with any delegate matching the signature:
IAmazonSQS Resolve(AltonQueueComponent queue);
public void Configure(IApplicationBuilder appBuilder)
{
app.MapAlton(
new AltonOptions
{
BaseRoute = "<api base route>",
QueuesToManage = new Dictionary<string, AltonQueueComponent>
{
["<Queue 1>"] = new()
{
QueueUrl = settings.AltonQueueUrl,
DeadLetterQueueUrl = settings.AltonDlqUrl
},
["<Queue 2>"] = new()
{
QueueUrl = settings.AltonQueueUrl,
DeadLetterQueueUrl = settings.AltonDlqUrl
}
// etc...
}
},
"AuthPolicyNameForTheseEndpoints", // This policy gets set in `.RequireAuthorization()`
endpoint => endpoint.IncludeInOpenApi()); // This lets you customise the endpoints further
}
Base route defaults to /queue-management
if not set.
Alton's Endpoints
Get State
Gets the overall state of the managed queues
GET /queue-states
[
{
"Name": "internalQueue",
"MessagesInQueue": 123,
"MessagesInDeadLetterQueue": 456
},
{
"Name": "externalQueue",
"MessagesInQueue": 789,
"MessagesInDeadLetterQueue": 0
}
]
Redrive All
Redrives all messages in a dead letter queue
POST /queues/<main queue name>/redrive-all
Returns:
No content
Retrieve Messages
Retrieves messages from the dead letter queue. The messages will become invisible whilst the visibility timeout is still valid. Once the visibility timeout has lapsed, you will not be able to make individual actions on the messages.
POST /queues/<queue name>/retrieve-messages
Content-Type: application/json
{
"VisibilityTimeout": 60
"MaxNumberOfMessages": 10
}
Returns:
[
{
"Body": "the message body",
"ReceiptHandle": "message-receipt-handle",
"Attributes": [
{
"Key": "message-attribute-key",
"DataType": "String",
"Value": "my message attribute"
}]
},
{
"Body": "Another message body",
"ReceiptHandle": "another-message-receipt-handle",
"Attributes": [
{
"Key": "message-attribute-key",
"DataType": "String",
"Value": "my message attribute"
}]
}
]
Delete Message
Delete individual messages after retrieving them. Message receipt handle can be obtained from retrieve-messages POST request
DELETE /queues/<queue name>/messages
Content-Type: application/json
{
"ReceiptHandle": "<message receipt handle>"
}
Returns:
No content
Purge Queue
Deletes all messages in a dead letter queue
DELETE /queues/<queue name>
Returns:
No content
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- AWSSDK.SQS (>= 3.7.300.5)
- Microsoft.AspNetCore.Routing (>= 2.2.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.