commit 19b08f1092b523942db719e167303e356717f70f Author: Nail Date: Thu Apr 9 07:20:27 2026 +0300 Initial README diff --git a/README.md b/README.md new file mode 100644 index 0000000..71a4628 --- /dev/null +++ b/README.md @@ -0,0 +1,89 @@ +# NGCloud SQS — Managed Message Queue Service + +Совместимый с Amazon SQS сервис очередей сообщений на базе [ElasticMQ](https://github.com/softwaremill/elasticmq). + +## Демо-стенд + +| | | +|---|---| +| **Web UI** | https://sqs.kube5s.ru/ | +| **SQS Endpoint** | `https://sqs.kube5s.ru/sqs/test001` | +| **Access Key** | `SQSAK-test001-ae4dc8` | +| **Secret Key** | `J8mElXq8Nwww8iFRtGJCm8KfxM9XSTluTqS2A67xsEE` | +| **Region** | `us-east-1` (любая) | + +## Быстрый тест (curl) + +### Создать очередь +```bash +curl -s -u "SQSAK-test001-ae4dc8:J8mElXq8Nwww8iFRtGJCm8KfxM9XSTluTqS2A67xsEE" \ + "https://sqs.kube5s.ru/sqs/test001?Action=CreateQueue&QueueName=myqueue&Version=2012-11-05" +``` + +### Отправить сообщение +```bash +curl -s -u "SQSAK-test001-ae4dc8:J8mElXq8Nwww8iFRtGJCm8KfxM9XSTluTqS2A67xsEE" \ + "https://sqs.kube5s.ru/sqs/test001?Action=SendMessage&QueueUrl=https://sqs.kube5s.ru/sqs/test001/test001/myqueue&MessageBody=HelloWorld&Version=2012-11-05" +``` + +### Получить сообщение +```bash +curl -s -u "SQSAK-test001-ae4dc8:J8mElXq8Nwww8iFRtGJCm8KfxM9XSTluTqS2A67xsEE" \ + "https://sqs.kube5s.ru/sqs/test001?Action=ReceiveMessage&QueueUrl=https://sqs.kube5s.ru/sqs/test001/test001/myqueue&Version=2012-11-05" +``` + +## Python (boto3) + +```python +import boto3 + +sqs = boto3.client( + "sqs", + endpoint_url="https://sqs.kube5s.ru/sqs/test001", + region_name="us-east-1", + aws_access_key_id="SQSAK-test001-ae4dc8", + aws_secret_access_key="J8mElXq8Nwww8iFRtGJCm8KfxM9XSTluTqS2A67xsEE", +) + +# Создать очередь +queue = sqs.create_queue(QueueName="myqueue") +print(queue["QueueUrl"]) + +# Отправить сообщение +sqs.send_message(QueueUrl=queue["QueueUrl"], MessageBody="Hello from Python!") + +# Получить сообщение +msgs = sqs.receive_message(QueueUrl=queue["QueueUrl"]) +print(msgs["Messages"][0]["Body"]) +``` + +## Node.js (@aws-sdk/client-sqs) + +```js +const { SQSClient, CreateQueueCommand, SendMessageCommand, ReceiveMessageCommand } = require("@aws-sdk/client-sqs"); + +const sqs = new SQSClient({ + endpoint: "https://sqs.kube5s.ru/sqs/test001", + region: "us-east-1", + credentials: { + accessKeyId: "SQSAK-test001-ae4dc8", + secretAccessKey: "J8mElXq8Nwww8iFRtGJCm8KfxM9XSTluTqS2A67xsEE", + }, +}); + +const queue = await sqs.send(new CreateQueueCommand({ QueueName: "myqueue" })); +await sqs.send(new SendMessageCommand({ QueueUrl: queue.QueueUrl, MessageBody: "Hello!" })); +const res = await sqs.send(new ReceiveMessageCommand({ QueueUrl: queue.QueueUrl })); +console.log(res.Messages[0].Body); +``` + +## Особенности + +- Полная совместимость с Amazon SQS API (AWS SDK работает без изменений — только endpoint меняется) +- Физическая изоляция: каждый тенант получает отдельный pod, namespace, диск +- Persistence: данные сохраняются при перезапуске +- Web UI для визуального управления очередями + +--- + +*Демо-среда. Для подключения своего тенанта — обратитесь к менеджеру.*