queen-mq 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/API.md +862 -752
- package/AUTH.md +2044 -0
- package/LICENSE.md +202 -0
- package/README.md +1705 -1051
- package/WEBAPP.md +1889 -0
- package/assets/dashboard-01.png +0 -0
- package/assets/queen-logo-blue.svg +210 -0
- package/assets/queen-logo-cyan.svg +210 -0
- package/assets/queen-logo-indigo.svg +210 -0
- package/assets/queen-logo-orange.svg +210 -0
- package/assets/queen-logo-pink.svg +210 -0
- package/assets/queen-logo-purple.svg +210 -0
- package/assets/queen-logo-rose.svg +239 -0
- package/assets/queen-logo.svg +263 -0
- package/examples/batch-processing.js +58 -0
- package/examples/test-complete-client.js +260 -0
- package/examples/test-dashboard-api.js +200 -0
- package/examples/test-traceid.js +147 -0
- package/package.json +17 -4
- package/server.log +1 -0
- package/src/benchmark/consumer.js +207 -0
- package/src/benchmark/consumer_multi.js +216 -0
- package/src/benchmark/producer.js +75 -0
- package/src/benchmark/producer_multi.js +115 -0
- package/src/client/client.js +300 -31
- package/src/client/queenClient.js +5 -0
- package/src/cluster-server.js +242 -0
- package/src/config.js +19 -5
- package/src/database/connection.js +42 -16
- package/src/database/poolManager.js +7 -0
- package/src/database/schema-v2.sql +194 -130
- package/src/managers/queueManagerOptimized.js +823 -933
- package/src/managers/systemEventManager.js +8 -3
- package/src/routes/messages.js +127 -57
- package/src/routes/pop.js +27 -43
- package/src/routes/resources.js +61 -27
- package/src/routes/status.js +1037 -0
- package/src/server.js +308 -272
- package/src/services/evictionService.js +57 -28
- package/src/services/retentionService.js +44 -11
- package/src/test/MIGRATION_ISSUES.md +174 -0
- package/src/test/README.md +203 -0
- package/src/test/advanced-pattern-tests.js +1137 -0
- package/src/test/bus-mode-tests.js +361 -0
- package/src/test/core-tests.js +342 -0
- package/src/test/edge-case-tests.js +561 -0
- package/src/test/enterprise-tests.js +637 -0
- package/src/test/partition-locking-tests.js +545 -0
- package/src/test/test-new.js +278 -0
- package/src/test/test.js +6 -3
- package/src/test/utils.js +169 -0
- package/src/utils/streaming.js +231 -0
- package/src/utils/uuid.js +2 -2
- package/src/websocket/wsServer.js +10 -3
- package/test-keepalive-v2.sh +22 -0
- package/webapp/COLOR_GUIDE.md +118 -0
- package/webapp/README.md +143 -0
- package/webapp/index.html +14 -0
- package/webapp/package-lock.json +3184 -0
- package/webapp/package.json +25 -0
- package/webapp/postcss.config.js +7 -0
- package/webapp/public/assets/queen-logo-blue.svg +210 -0
- package/webapp/public/assets/queen-logo-cyan.svg +210 -0
- package/webapp/public/assets/queen-logo-indigo.svg +210 -0
- package/webapp/public/assets/queen-logo-orange.svg +210 -0
- package/webapp/public/assets/queen-logo-pink.svg +210 -0
- package/webapp/public/assets/queen-logo-purple.svg +210 -0
- package/webapp/public/assets/queen-logo-rose.svg +239 -0
- package/webapp/public/assets/queen-logo.svg +263 -0
- package/webapp/src/App.vue +19 -0
- package/webapp/src/api/analytics.js +10 -0
- package/webapp/src/api/client.js +29 -0
- package/webapp/src/api/consumers.js +52 -0
- package/webapp/src/api/health.js +7 -0
- package/webapp/src/api/messages.js +26 -0
- package/webapp/src/api/queues.js +14 -0
- package/webapp/src/api/resources.js +8 -0
- package/webapp/src/assets/styles/main.css +357 -0
- package/webapp/src/components/analytics/AnalyticsFilters.vue +87 -0
- package/webapp/src/components/analytics/AnalyticsMetrics.vue +57 -0
- package/webapp/src/components/analytics/MessageDistributionChart.vue +111 -0
- package/webapp/src/components/analytics/MessageFlowChart.vue +173 -0
- package/webapp/src/components/analytics/TimeRangeSelector.vue +27 -0
- package/webapp/src/components/analytics/TopQueuesChart.vue +132 -0
- package/webapp/src/components/common/ConfirmDialog.vue +56 -0
- package/webapp/src/components/common/LoadingSpinner.vue +6 -0
- package/webapp/src/components/common/MetricCard.vue +43 -0
- package/webapp/src/components/common/StatusBadge.vue +45 -0
- package/webapp/src/components/dashboard/MessageStatusCard.vue +50 -0
- package/webapp/src/components/dashboard/PerformanceCard.vue +38 -0
- package/webapp/src/components/dashboard/ThroughputChart.vue +182 -0
- package/webapp/src/components/dashboard/TopQueuesTable.vue +53 -0
- package/webapp/src/components/layout/AppLayout.vue +110 -0
- package/webapp/src/components/layout/AppSidebar.vue +304 -0
- package/webapp/src/components/messages/MessageDetailPanel.vue +242 -0
- package/webapp/src/components/messages/MessageFilters.vue +114 -0
- package/webapp/src/components/queue-detail/PartitionList.vue +79 -0
- package/webapp/src/components/queue-detail/PushMessageModal.vue +175 -0
- package/webapp/src/components/queue-detail/QueueConfig.vue +63 -0
- package/webapp/src/components/queue-detail/QueueDetailHeader.vue +53 -0
- package/webapp/src/components/queue-detail/RecentMessages.vue +76 -0
- package/webapp/src/components/queues/CreateQueueModal.vue +193 -0
- package/webapp/src/components/queues/QueueFilters.vue +90 -0
- package/webapp/src/composables/useApi.js +34 -0
- package/webapp/src/composables/useTheme.js +36 -0
- package/webapp/src/main.js +11 -0
- package/webapp/src/router/index.js +42 -0
- package/webapp/src/utils/colors.js +96 -0
- package/webapp/src/utils/formatters.js +49 -0
- package/webapp/src/views/Analytics.vue +377 -0
- package/webapp/src/views/ConsumerGroups.vue +433 -0
- package/webapp/src/views/Dashboard.vue +418 -0
- package/webapp/src/views/Messages.vue +361 -0
- package/webapp/src/views/QueueDetail.vue +582 -0
- package/webapp/src/views/Queues.vue +496 -0
- package/webapp/tailwind.config.js +25 -0
- package/webapp/vite.config.js +10 -0
- package/CACHE.md +0 -519
- package/DASHBOARD-V3.md +0 -478
- package/DASHBOARD.md +0 -382
- package/MOD_QUEUE.md +0 -453
- package/PARTITION_LOCKING_DESIGN.md +0 -989
- package/PLAN.md +0 -707
- package/QUERY_ANALSYS.md +0 -72
- package/QUEUE_BUS.md +0 -334
- package/V2-PLAN.md +0 -236
- package/dashboard/.vscode/extensions.json +0 -3
- package/dashboard/README.md +0 -5
- package/dashboard/index.html +0 -14
- package/dashboard/package-lock.json +0 -1458
- package/dashboard/package.json +0 -25
- package/dashboard/public/vite.svg +0 -1
- package/dashboard/src/App.vue +0 -29
- package/dashboard/src/assets/styles/main.css +0 -908
- package/dashboard/src/assets/vue.svg +0 -1
- package/dashboard/src/components/cards/MetricCard.vue +0 -298
- package/dashboard/src/components/charts/QueueDepthChart.vue +0 -276
- package/dashboard/src/components/charts/QueueLagChart.vue +0 -436
- package/dashboard/src/components/charts/ThroughputChart.vue +0 -302
- package/dashboard/src/components/common/ActivityFeed.vue +0 -251
- package/dashboard/src/components/layout/AppHeader.vue +0 -208
- package/dashboard/src/components/layout/AppLayout.vue +0 -88
- package/dashboard/src/components/layout/AppSidebar.vue +0 -261
- package/dashboard/src/main.js +0 -44
- package/dashboard/src/router.js +0 -54
- package/dashboard/src/services/api.js +0 -187
- package/dashboard/src/services/websocket.js +0 -167
- package/dashboard/src/utils/constants.js +0 -56
- package/dashboard/src/utils/helpers.js +0 -118
- package/dashboard/src/views/Analytics.vue +0 -912
- package/dashboard/src/views/Dashboard.vue +0 -906
- package/dashboard/src/views/Messages.vue +0 -437
- package/dashboard/src/views/QueueDetail.vue +0 -501
- package/dashboard/src/views/Queues.vue +0 -333
- package/dashboard/vite.config.js +0 -30
- package/debug-namespace.js +0 -110
- package/docs/long-polling.md +0 -159
- package/docs/multi-server-cache-solutions.md +0 -185
- package/docs/performance-tuning.md +0 -222
- package/src/routes/analytics.js +0 -812
package/API.md
CHANGED
|
@@ -1,1056 +1,1108 @@
|
|
|
1
|
-
# Queen
|
|
1
|
+
# Queen Message Queue - API Documentation
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Base URL:** `http://localhost:6632`
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
- **Queues**: Top-level organizational units
|
|
7
|
-
- **Partitions**: Subdivisions within queues where FIFO ordering is maintained
|
|
5
|
+
**API Version:** v1
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
## Core Concepts
|
|
12
|
-
|
|
13
|
-
### Message Flow
|
|
14
|
-
1. Messages are **pushed** to a queue (optionally specifying a partition)
|
|
15
|
-
2. Messages are **popped** from either a specific partition or any partition in a queue
|
|
16
|
-
3. Messages must be **acknowledged** after processing (completed or failed)
|
|
17
|
-
|
|
18
|
-
### Partitions
|
|
19
|
-
- Every queue automatically has a "Default" partition
|
|
20
|
-
- Additional partitions can be created by pushing messages to them
|
|
21
|
-
- FIFO ordering is maintained within each partition
|
|
22
|
-
- Messages without a specified partition go to "Default"
|
|
23
|
-
|
|
24
|
-
### Optional Grouping
|
|
25
|
-
- Queues can have optional `namespace` and `task` fields for logical grouping
|
|
26
|
-
- These don't affect the hierarchy but allow filtering operations
|
|
7
|
+
**Date:** October 15, 2025
|
|
27
8
|
|
|
28
9
|
---
|
|
29
10
|
|
|
30
|
-
##
|
|
11
|
+
## Table of Contents
|
|
31
12
|
|
|
32
|
-
|
|
33
|
-
|
|
13
|
+
1. [Authentication](#authentication)
|
|
14
|
+
2. [Health & Monitoring](#health--monitoring)
|
|
15
|
+
3. [Queue Management](#queue-management)
|
|
16
|
+
4. [Message Operations](#message-operations)
|
|
17
|
+
5. [Resource Queries](#resource-queries)
|
|
18
|
+
6. [Status & Analytics](#status--analytics)
|
|
19
|
+
7. [Error Responses](#error-responses)
|
|
34
20
|
|
|
35
|
-
|
|
21
|
+
---
|
|
36
22
|
|
|
37
|
-
|
|
38
|
-
```json
|
|
39
|
-
{
|
|
40
|
-
"items": [
|
|
41
|
-
{
|
|
42
|
-
"queue": "email-queue", // Required: queue name
|
|
43
|
-
"partition": "urgent", // Optional: defaults to "Default"
|
|
44
|
-
"payload": { // Required: message data (JSON)
|
|
45
|
-
"to": "user@example.com",
|
|
46
|
-
"subject": "Hello"
|
|
47
|
-
},
|
|
48
|
-
"transactionId": "uuid-here" // Optional: idempotency key
|
|
49
|
-
}
|
|
50
|
-
]
|
|
51
|
-
}
|
|
52
|
-
```
|
|
23
|
+
## Authentication
|
|
53
24
|
|
|
54
|
-
|
|
55
|
-
```json
|
|
56
|
-
{
|
|
57
|
-
"messages": [
|
|
58
|
-
{
|
|
59
|
-
"id": "018e63b7-6165-453f-88ae-56effa177605",
|
|
60
|
-
"transactionId": "4dfb0478-655b-4c91-bcd9-b7acacf0400f",
|
|
61
|
-
"status": "queued" // or "duplicate" if transactionId exists
|
|
62
|
-
}
|
|
63
|
-
]
|
|
64
|
-
}
|
|
65
|
-
```
|
|
25
|
+
Currently, the Queen API does not require authentication. All endpoints are publicly accessible. CORS is enabled with the following headers:
|
|
66
26
|
|
|
67
|
-
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
- Creates queue/partition if they don't exist
|
|
27
|
+
- `Access-Control-Allow-Origin`: `*`
|
|
28
|
+
- `Access-Control-Allow-Methods`: `GET, POST, PUT, DELETE, OPTIONS`
|
|
29
|
+
- `Access-Control-Allow-Headers`: `Content-Type, Authorization`
|
|
71
30
|
|
|
72
31
|
---
|
|
73
32
|
|
|
74
|
-
|
|
33
|
+
## Health & Monitoring
|
|
75
34
|
|
|
76
|
-
|
|
77
|
-
**Endpoint:** `GET /api/v1/pop/queue/:queue/partition/:partition`
|
|
35
|
+
### GET /health
|
|
78
36
|
|
|
79
|
-
|
|
37
|
+
**Purpose:** Check server health and get basic performance statistics.
|
|
80
38
|
|
|
81
|
-
**
|
|
82
|
-
- `batch` (integer): Number of messages to retrieve (default: 1)
|
|
83
|
-
- `wait` (boolean): Enable long polling (default: false)
|
|
84
|
-
- `timeout` (integer): Long polling timeout in ms (default: 30000, max: 60000)
|
|
39
|
+
**Authentication:** None
|
|
85
40
|
|
|
86
|
-
**
|
|
87
|
-
```
|
|
88
|
-
GET /api/v1/pop/queue/emails/partition/urgent?batch=5&wait=true
|
|
89
|
-
```
|
|
41
|
+
**Query Parameters:** None
|
|
90
42
|
|
|
91
43
|
**Response:**
|
|
92
44
|
```json
|
|
93
45
|
{
|
|
94
|
-
"
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
"
|
|
46
|
+
"status": "healthy",
|
|
47
|
+
"uptime": "30s",
|
|
48
|
+
"connections": 0,
|
|
49
|
+
"stats": {
|
|
50
|
+
"requests": 0,
|
|
51
|
+
"messages": 0,
|
|
52
|
+
"requestsPerSecond": "0.00",
|
|
53
|
+
"messagesPerSecond": "0.00",
|
|
54
|
+
"pool": {
|
|
55
|
+
"total": 3,
|
|
56
|
+
"idle": 3,
|
|
57
|
+
"waiting": 0
|
|
106
58
|
}
|
|
107
|
-
|
|
59
|
+
}
|
|
108
60
|
}
|
|
109
61
|
```
|
|
110
62
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
Retrieves messages from any available partition in the queue (oldest first).
|
|
63
|
+
**Status Codes:**
|
|
64
|
+
- `200`: Server is healthy
|
|
65
|
+
- `503`: Server is unhealthy
|
|
115
66
|
|
|
116
|
-
|
|
67
|
+
---
|
|
117
68
|
|
|
118
|
-
|
|
119
|
-
```
|
|
120
|
-
GET /api/v1/pop/queue/emails?batch=10
|
|
121
|
-
```
|
|
69
|
+
### GET /metrics
|
|
122
70
|
|
|
123
|
-
|
|
124
|
-
**Endpoint:** `GET /api/v1/pop`
|
|
71
|
+
**Purpose:** Get detailed performance metrics for monitoring and observability.
|
|
125
72
|
|
|
126
|
-
|
|
73
|
+
**Authentication:** None
|
|
127
74
|
|
|
128
|
-
**Query Parameters:**
|
|
129
|
-
- `namespace` (string): Filter by namespace
|
|
130
|
-
- `task` (string): Filter by task
|
|
131
|
-
- `batch`, `wait`, `timeout`: Same as above
|
|
75
|
+
**Query Parameters:** None
|
|
132
76
|
|
|
133
|
-
**
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
|
|
77
|
+
**Response:**
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"uptime": 44.691,
|
|
81
|
+
"requests": {
|
|
82
|
+
"total": 0,
|
|
83
|
+
"rate": 0
|
|
84
|
+
},
|
|
85
|
+
"messages": {
|
|
86
|
+
"total": 0,
|
|
87
|
+
"rate": 0
|
|
88
|
+
},
|
|
89
|
+
"database": {
|
|
90
|
+
"poolSize": 3,
|
|
91
|
+
"idleConnections": 3,
|
|
92
|
+
"waitingRequests": 0
|
|
93
|
+
},
|
|
94
|
+
"memory": {
|
|
95
|
+
"rss": 51740672,
|
|
96
|
+
"heapTotal": 9224192,
|
|
97
|
+
"heapUsed": 7700024,
|
|
98
|
+
"external": 2189469,
|
|
99
|
+
"arrayBuffers": 103809
|
|
100
|
+
},
|
|
101
|
+
"cpu": {
|
|
102
|
+
"user": 179881,
|
|
103
|
+
"system": 47586
|
|
104
|
+
}
|
|
105
|
+
}
|
|
137
106
|
```
|
|
138
107
|
|
|
139
|
-
**Response Format:** Same as above
|
|
140
|
-
|
|
141
108
|
**Status Codes:**
|
|
142
|
-
- `200`:
|
|
143
|
-
- `204`: No messages available (empty response)
|
|
109
|
+
- `200`: Success
|
|
144
110
|
|
|
145
111
|
---
|
|
146
112
|
|
|
147
|
-
|
|
113
|
+
## Queue Management
|
|
148
114
|
|
|
149
|
-
|
|
150
|
-
**Endpoint:** `POST /api/v1/ack`
|
|
115
|
+
### POST /api/v1/configure
|
|
151
116
|
|
|
152
|
-
|
|
117
|
+
**Purpose:** Create or configure a queue with specific settings and partitions.
|
|
118
|
+
|
|
119
|
+
**Authentication:** None
|
|
153
120
|
|
|
154
121
|
**Request Body:**
|
|
155
122
|
```json
|
|
156
123
|
{
|
|
157
|
-
"
|
|
158
|
-
"
|
|
159
|
-
"
|
|
124
|
+
"queue": "test-queue",
|
|
125
|
+
"partition": "Default",
|
|
126
|
+
"ttl": 300,
|
|
127
|
+
"priority": 1,
|
|
128
|
+
"maxQueueSize": 1000
|
|
160
129
|
}
|
|
161
130
|
```
|
|
162
131
|
|
|
132
|
+
**Parameters:**
|
|
133
|
+
- `queue` (string, required): Queue name
|
|
134
|
+
- `partition` (string, optional): Partition name (defaults to "Default")
|
|
135
|
+
- `ttl` (number, optional): Time-to-live in seconds
|
|
136
|
+
- `priority` (number, optional): Queue priority (0-100)
|
|
137
|
+
- `maxQueueSize` (number, optional): Maximum queue size
|
|
138
|
+
- `leaseTime` (number, optional): Lease time for messages in seconds
|
|
139
|
+
- `retryLimit` (number, optional): Maximum retry attempts
|
|
140
|
+
- `retryDelay` (number, optional): Delay between retries in milliseconds
|
|
141
|
+
|
|
163
142
|
**Response:**
|
|
164
143
|
```json
|
|
165
144
|
{
|
|
166
|
-
"
|
|
167
|
-
"
|
|
168
|
-
"
|
|
145
|
+
"queue": "test-queue",
|
|
146
|
+
"namespace": null,
|
|
147
|
+
"task": null,
|
|
148
|
+
"configured": true,
|
|
149
|
+
"options": {
|
|
150
|
+
"leaseTime": 300,
|
|
151
|
+
"maxSize": 10000,
|
|
152
|
+
"ttl": 3600,
|
|
153
|
+
"retryLimit": 3,
|
|
154
|
+
"retryDelay": 1000,
|
|
155
|
+
"deadLetterQueue": false,
|
|
156
|
+
"dlqAfterMaxRetries": false,
|
|
157
|
+
"priority": 0,
|
|
158
|
+
"delayedProcessing": 0,
|
|
159
|
+
"windowBuffer": 0,
|
|
160
|
+
"retentionSeconds": 0,
|
|
161
|
+
"completedRetentionSeconds": 0,
|
|
162
|
+
"retentionEnabled": false
|
|
163
|
+
},
|
|
164
|
+
"partition": "Default",
|
|
165
|
+
"_deprecation_notice": "Partition-level configuration is deprecated. All configuration is now at queue level."
|
|
169
166
|
}
|
|
170
167
|
```
|
|
171
168
|
|
|
172
|
-
|
|
173
|
-
|
|
169
|
+
**Status Codes:**
|
|
170
|
+
- `201`: Queue configured successfully
|
|
171
|
+
- `400`: Invalid request body
|
|
172
|
+
- `500`: Internal server error
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Message Operations
|
|
177
|
+
|
|
178
|
+
### POST /api/v1/push
|
|
174
179
|
|
|
175
|
-
|
|
180
|
+
**Purpose:** Push one or more messages to a queue.
|
|
181
|
+
|
|
182
|
+
**Authentication:** None
|
|
176
183
|
|
|
177
184
|
**Request Body:**
|
|
178
185
|
```json
|
|
179
186
|
{
|
|
180
|
-
"
|
|
181
|
-
{
|
|
182
|
-
"transactionId": "uuid-1",
|
|
183
|
-
"status": "completed"
|
|
184
|
-
},
|
|
187
|
+
"items": [
|
|
185
188
|
{
|
|
186
|
-
"
|
|
187
|
-
"
|
|
188
|
-
"
|
|
189
|
+
"queue": "test-queue",
|
|
190
|
+
"partition": "Default",
|
|
191
|
+
"payload": {
|
|
192
|
+
"message": "Hello World"
|
|
193
|
+
},
|
|
194
|
+
"ttl": 300,
|
|
195
|
+
"priority": 1,
|
|
196
|
+
"traceId": "optional-trace-id"
|
|
189
197
|
}
|
|
190
198
|
]
|
|
191
199
|
}
|
|
192
200
|
```
|
|
193
201
|
|
|
202
|
+
**Parameters:**
|
|
203
|
+
- `items` (array, required): Array of messages to push
|
|
204
|
+
- `queue` (string, required): Queue name
|
|
205
|
+
- `partition` (string, optional): Partition name (defaults to "Default")
|
|
206
|
+
- `payload` (object, required): Message payload (any JSON object)
|
|
207
|
+
- `ttl` (number, optional): Message time-to-live in seconds
|
|
208
|
+
- `priority` (number, optional): Message priority
|
|
209
|
+
- `traceId` (string, optional): Trace ID for distributed tracing
|
|
210
|
+
|
|
194
211
|
**Response:**
|
|
195
212
|
```json
|
|
196
213
|
{
|
|
197
|
-
"
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
214
|
+
"messages": [
|
|
215
|
+
{
|
|
216
|
+
"id": "0199e688-1857-7462-81ea-b87975de7e95",
|
|
217
|
+
"transactionId": "0199e688-1857-7462-81ea-b4fe7532bbde",
|
|
218
|
+
"traceId": null,
|
|
219
|
+
"status": "queued"
|
|
220
|
+
}
|
|
201
221
|
]
|
|
202
222
|
}
|
|
203
223
|
```
|
|
204
224
|
|
|
205
|
-
**
|
|
206
|
-
-
|
|
207
|
-
-
|
|
225
|
+
**Status Codes:**
|
|
226
|
+
- `201`: Messages pushed successfully
|
|
227
|
+
- `400`: Invalid request body
|
|
228
|
+
- `500`: Internal server error
|
|
208
229
|
|
|
209
230
|
---
|
|
210
231
|
|
|
211
|
-
###
|
|
212
|
-
**Endpoint:** `POST /api/v1/configure`
|
|
232
|
+
### GET /api/v1/pop/queue/:queue/partition/:partition
|
|
213
233
|
|
|
214
|
-
|
|
234
|
+
**Purpose:** Pop messages from a specific queue and partition.
|
|
215
235
|
|
|
216
|
-
**
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
"windowBuffer": 0, // Buffer window for message processing (seconds)
|
|
230
|
-
"retentionSeconds": 0, // Auto-delete pending messages after X seconds
|
|
231
|
-
"completedRetentionSeconds": 0, // Auto-delete completed messages after X seconds
|
|
232
|
-
"retentionEnabled": false, // Enable retention policies
|
|
233
|
-
"encryptionEnabled": false, // Enable message encryption
|
|
234
|
-
"maxWaitTimeSeconds": 0 // Max wait time for long polling
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
```
|
|
236
|
+
**Authentication:** None
|
|
237
|
+
|
|
238
|
+
**Path Parameters:**
|
|
239
|
+
- `queue` (string): Queue name
|
|
240
|
+
- `partition` (string): Partition name
|
|
241
|
+
|
|
242
|
+
**Query Parameters:**
|
|
243
|
+
- `wait` (boolean, optional): Wait for messages if queue is empty (default: false)
|
|
244
|
+
- `timeout` (number, optional): Wait timeout in milliseconds (default: 30000)
|
|
245
|
+
- `batch` (number, optional): Number of messages to pop (default: 1)
|
|
246
|
+
- `consumerGroup` (string, optional): Consumer group name for subscription mode
|
|
247
|
+
- `subscriptionMode` (string, optional): Subscription mode: "earliest", "latest", "timestamp"
|
|
248
|
+
- `subscriptionFrom` (string, optional): Starting point for subscription
|
|
238
249
|
|
|
239
250
|
**Response:**
|
|
240
251
|
```json
|
|
241
252
|
{
|
|
242
|
-
"
|
|
243
|
-
|
|
244
|
-
|
|
253
|
+
"messages": [
|
|
254
|
+
{
|
|
255
|
+
"id": "0199e688-1857-7462-81ea-b87975de7e95",
|
|
256
|
+
"transactionId": "0199e688-1857-7462-81ea-b4fe7532bbde",
|
|
257
|
+
"traceId": null,
|
|
258
|
+
"queue": "test-queue",
|
|
259
|
+
"partition": "Default",
|
|
260
|
+
"data": {
|
|
261
|
+
"message": "Hello World"
|
|
262
|
+
},
|
|
263
|
+
"payload": {
|
|
264
|
+
"message": "Hello World"
|
|
265
|
+
},
|
|
266
|
+
"retryCount": 0,
|
|
267
|
+
"priority": "0",
|
|
268
|
+
"createdAt": "2025-10-15T06:21:42.865Z",
|
|
269
|
+
"consumerGroup": null
|
|
270
|
+
}
|
|
271
|
+
]
|
|
245
272
|
}
|
|
246
273
|
```
|
|
247
274
|
|
|
248
|
-
**
|
|
275
|
+
**Status Codes:**
|
|
276
|
+
- `200`: Messages retrieved successfully
|
|
277
|
+
- `204`: No messages available
|
|
278
|
+
- `500`: Internal server error
|
|
249
279
|
|
|
250
280
|
---
|
|
251
281
|
|
|
252
|
-
###
|
|
282
|
+
### GET /api/v1/pop/queue/:queue
|
|
253
283
|
|
|
254
|
-
|
|
255
|
-
**Endpoint:** `GET /api/v1/analytics/queue/:queue`
|
|
284
|
+
**Purpose:** Pop messages from a queue (any partition).
|
|
256
285
|
|
|
257
|
-
|
|
286
|
+
**Authentication:** None
|
|
258
287
|
|
|
259
|
-
**
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
"totals": {
|
|
266
|
-
"pending": 10,
|
|
267
|
-
"processing": 5,
|
|
268
|
-
"completed": 100,
|
|
269
|
-
"failed": 2,
|
|
270
|
-
"deadLetter": 1,
|
|
271
|
-
"total": 118
|
|
272
|
-
},
|
|
273
|
-
"partitions": [
|
|
274
|
-
{
|
|
275
|
-
"name": "Default",
|
|
276
|
-
"stats": {
|
|
277
|
-
"pending": 8,
|
|
278
|
-
"processing": 3,
|
|
279
|
-
"completed": 80,
|
|
280
|
-
"failed": 1,
|
|
281
|
-
"deadLetter": 0,
|
|
282
|
-
"total": 92
|
|
283
|
-
}
|
|
284
|
-
},
|
|
285
|
-
{
|
|
286
|
-
"name": "urgent",
|
|
287
|
-
"stats": {
|
|
288
|
-
"pending": 2,
|
|
289
|
-
"processing": 2,
|
|
290
|
-
"completed": 20,
|
|
291
|
-
"failed": 1,
|
|
292
|
-
"deadLetter": 1,
|
|
293
|
-
"total": 26
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
]
|
|
297
|
-
}
|
|
298
|
-
```
|
|
288
|
+
**Path Parameters:**
|
|
289
|
+
- `queue` (string): Queue name
|
|
290
|
+
|
|
291
|
+
**Query Parameters:** Same as `/api/v1/pop/queue/:queue/partition/:partition`
|
|
292
|
+
|
|
293
|
+
**Response:** Same as `/api/v1/pop/queue/:queue/partition/:partition`
|
|
299
294
|
|
|
300
|
-
|
|
301
|
-
|
|
295
|
+
**Status Codes:**
|
|
296
|
+
- `200`: Messages retrieved successfully
|
|
297
|
+
- `204`: No messages available
|
|
298
|
+
- `500`: Internal server error
|
|
299
|
+
|
|
300
|
+
---
|
|
302
301
|
|
|
303
|
-
|
|
302
|
+
### GET /api/v1/pop
|
|
303
|
+
|
|
304
|
+
**Purpose:** Pop messages from queues filtered by namespace or task.
|
|
305
|
+
|
|
306
|
+
**Authentication:** None
|
|
304
307
|
|
|
305
308
|
**Query Parameters:**
|
|
306
|
-
- `namespace` (string): Filter by namespace
|
|
307
|
-
- `task` (string): Filter by task
|
|
309
|
+
- `namespace` (string, optional): Filter by namespace
|
|
310
|
+
- `task` (string, optional): Filter by task
|
|
311
|
+
- `wait` (boolean, optional): Wait for messages if queue is empty
|
|
312
|
+
- `timeout` (number, optional): Wait timeout in milliseconds
|
|
313
|
+
- `batch` (number, optional): Number of messages to pop
|
|
314
|
+
- `consumerGroup` (string, optional): Consumer group name
|
|
308
315
|
|
|
309
|
-
**Response:**
|
|
316
|
+
**Response:** Same as `/api/v1/pop/queue/:queue/partition/:partition`
|
|
317
|
+
|
|
318
|
+
**Status Codes:**
|
|
319
|
+
- `200`: Messages retrieved successfully
|
|
320
|
+
- `204`: No messages available
|
|
321
|
+
- `500`: Internal server error
|
|
322
|
+
|
|
323
|
+
---
|
|
324
|
+
|
|
325
|
+
### POST /api/v1/ack
|
|
326
|
+
|
|
327
|
+
**Purpose:** Acknowledge a single message as completed or failed.
|
|
328
|
+
|
|
329
|
+
**Authentication:** None
|
|
330
|
+
|
|
331
|
+
**Request Body:**
|
|
310
332
|
```json
|
|
311
333
|
{
|
|
312
|
-
"
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
"namespace": "production",
|
|
316
|
-
"task": "notifications",
|
|
317
|
-
"partitions": [...],
|
|
318
|
-
"totals": {...}
|
|
319
|
-
}
|
|
320
|
-
]
|
|
334
|
+
"transactionId": "0199e688-4d29-7019-bf32-5d4f21306b35",
|
|
335
|
+
"status": "completed",
|
|
336
|
+
"error": "optional error message if failed"
|
|
321
337
|
}
|
|
322
338
|
```
|
|
323
339
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
340
|
+
**Parameters:**
|
|
341
|
+
- `transactionId` (string, required): Transaction ID of the message
|
|
342
|
+
- `status` (string, required): "completed" or "failed"
|
|
343
|
+
- `error` (string, optional): Error message if status is "failed"
|
|
344
|
+
- `consumerGroup` (string, optional): Consumer group name
|
|
328
345
|
|
|
329
346
|
**Response:**
|
|
330
347
|
```json
|
|
331
348
|
{
|
|
332
|
-
"
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
"depth": 10, // Total pending
|
|
336
|
-
"processing": 5, // Total processing
|
|
337
|
-
"partitions": [
|
|
338
|
-
{ "name": "Default", "depth": 8, "processing": 3 },
|
|
339
|
-
{ "name": "urgent", "depth": 2, "processing": 2 }
|
|
340
|
-
]
|
|
341
|
-
}
|
|
342
|
-
]
|
|
349
|
+
"status": "completed",
|
|
350
|
+
"consumerGroup": null,
|
|
351
|
+
"acknowledgedAt": "2025-10-15T06:22:02.382Z"
|
|
343
352
|
}
|
|
344
353
|
```
|
|
345
354
|
|
|
346
|
-
|
|
347
|
-
|
|
355
|
+
**Status Codes:**
|
|
356
|
+
- `200`: Acknowledgment successful
|
|
357
|
+
- `400`: Invalid request body
|
|
358
|
+
- `500`: Internal server error
|
|
348
359
|
|
|
349
|
-
|
|
360
|
+
---
|
|
350
361
|
|
|
351
|
-
|
|
362
|
+
### POST /api/v1/ack/batch
|
|
363
|
+
|
|
364
|
+
**Purpose:** Acknowledge multiple messages in a single request.
|
|
365
|
+
|
|
366
|
+
**Authentication:** None
|
|
367
|
+
|
|
368
|
+
**Request Body:**
|
|
352
369
|
```json
|
|
353
370
|
{
|
|
354
|
-
"
|
|
371
|
+
"acknowledgments": [
|
|
355
372
|
{
|
|
356
|
-
"
|
|
357
|
-
"
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
"
|
|
362
|
-
|
|
363
|
-
"messagesPerSecond": 1
|
|
364
|
-
},
|
|
365
|
-
"processing": {
|
|
366
|
-
"messagesPerMinute": 100,
|
|
367
|
-
"messagesPerSecond": 1
|
|
368
|
-
},
|
|
369
|
-
"failed": {
|
|
370
|
-
"messagesPerMinute": 5,
|
|
371
|
-
"messagesPerSecond": 0
|
|
372
|
-
},
|
|
373
|
-
"lag": {
|
|
374
|
-
"avgSeconds": 2.5,
|
|
375
|
-
"avgMilliseconds": 2500,
|
|
376
|
-
"sampleCount": 115
|
|
377
|
-
}
|
|
373
|
+
"transactionId": "0199e688-6c45-769d-921b-527ee7c3d57c",
|
|
374
|
+
"status": "completed"
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
"transactionId": "0199e688-6c45-769d-921b-55f611d0cd5a",
|
|
378
|
+
"status": "failed",
|
|
379
|
+
"error": "Test error"
|
|
378
380
|
}
|
|
379
|
-
|
|
380
|
-
|
|
381
|
+
],
|
|
382
|
+
"consumerGroup": "optional-consumer-group"
|
|
381
383
|
}
|
|
382
384
|
```
|
|
383
385
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
- `queue` (string): Filter by queue name
|
|
391
|
-
- `namespace` (string): Filter by namespace
|
|
392
|
-
- `task` (string): Filter by task
|
|
386
|
+
**Parameters:**
|
|
387
|
+
- `acknowledgments` (array, required): Array of acknowledgments
|
|
388
|
+
- `transactionId` (string, required): Transaction ID
|
|
389
|
+
- `status` (string, required): "completed" or "failed"
|
|
390
|
+
- `error` (string, optional): Error message if failed
|
|
391
|
+
- `consumerGroup` (string, optional): Consumer group name
|
|
393
392
|
|
|
394
393
|
**Response:**
|
|
395
394
|
```json
|
|
396
395
|
{
|
|
397
|
-
"
|
|
396
|
+
"processed": 2,
|
|
397
|
+
"results": [
|
|
398
398
|
{
|
|
399
|
-
"
|
|
400
|
-
"
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
"stats": {
|
|
406
|
-
"pendingCount": 150,
|
|
407
|
-
"processingCount": 25,
|
|
408
|
-
"totalBacklog": 175,
|
|
409
|
-
"completedMessages": 1250,
|
|
410
|
-
"avgProcessingTimeSeconds": 2.5,
|
|
411
|
-
"medianProcessingTimeSeconds": 2.1,
|
|
412
|
-
"p95ProcessingTimeSeconds": 4.8,
|
|
413
|
-
"estimatedLagSeconds": 437.5,
|
|
414
|
-
"medianLagSeconds": 367.5,
|
|
415
|
-
"p95LagSeconds": 840.0,
|
|
416
|
-
"estimatedLag": "7m 17s",
|
|
417
|
-
"medianLag": "6m 7s",
|
|
418
|
-
"p95Lag": "14m 0s",
|
|
419
|
-
"avgProcessingTime": "2.5s",
|
|
420
|
-
"medianProcessingTime": "2.1s",
|
|
421
|
-
"p95ProcessingTime": "4.8s"
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
],
|
|
425
|
-
"totals": {
|
|
426
|
-
"pendingCount": 150,
|
|
427
|
-
"processingCount": 25,
|
|
428
|
-
"totalBacklog": 175,
|
|
429
|
-
"completedMessages": 1250,
|
|
430
|
-
"avgProcessingTimeSeconds": 2.5,
|
|
431
|
-
"medianProcessingTimeSeconds": 2.1,
|
|
432
|
-
"p95ProcessingTimeSeconds": 4.8,
|
|
433
|
-
"estimatedLagSeconds": 437.5,
|
|
434
|
-
"medianLagSeconds": 367.5,
|
|
435
|
-
"p95LagSeconds": 840.0,
|
|
436
|
-
"estimatedLag": "7m 17s",
|
|
437
|
-
"medianLag": "6m 7s",
|
|
438
|
-
"p95Lag": "14m 0s",
|
|
439
|
-
"avgProcessingTime": "2.5s",
|
|
440
|
-
"medianProcessingTime": "2.1s",
|
|
441
|
-
"p95ProcessingTime": "4.8s"
|
|
442
|
-
}
|
|
399
|
+
"transactionId": "0199e688-6c45-769d-921b-527ee7c3d57c",
|
|
400
|
+
"status": "completed"
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
"transactionId": "0199e688-6c45-769d-921b-55f611d0cd5a",
|
|
404
|
+
"status": "failed_dlq"
|
|
443
405
|
}
|
|
444
406
|
]
|
|
445
407
|
}
|
|
446
408
|
```
|
|
447
409
|
|
|
448
|
-
**
|
|
449
|
-
-
|
|
450
|
-
-
|
|
451
|
-
-
|
|
410
|
+
**Status Codes:**
|
|
411
|
+
- `200`: Batch acknowledgment successful
|
|
412
|
+
- `400`: Invalid request body
|
|
413
|
+
- `500`: Internal server error
|
|
452
414
|
|
|
453
|
-
|
|
454
|
-
- Only includes queues with at least 5 completed messages in the last 24 hours
|
|
455
|
-
- Processing times are calculated from `completed_at - created_at` for completed messages
|
|
456
|
-
- Lag represents the estimated time for all current backlog to be processed
|
|
415
|
+
---
|
|
457
416
|
|
|
458
|
-
|
|
459
|
-
**Endpoint:** `GET /api/v1/analytics/queue-stats`
|
|
417
|
+
### GET /api/v1/messages
|
|
460
418
|
|
|
461
|
-
|
|
419
|
+
**Purpose:** List messages with optional filters.
|
|
420
|
+
|
|
421
|
+
**Authentication:** None
|
|
462
422
|
|
|
463
423
|
**Query Parameters:**
|
|
464
|
-
- `queue` (string): Filter by queue name
|
|
465
|
-
- `
|
|
466
|
-
- `task` (string): Filter by task
|
|
424
|
+
- `queue` (string, optional): Filter by queue name
|
|
425
|
+
- `ns` (string, optional): Filter by namespace
|
|
426
|
+
- `task` (string, optional): Filter by task
|
|
427
|
+
- `status` (string, optional): Filter by status
|
|
428
|
+
- `limit` (number, optional): Number of messages to return (default: 100)
|
|
429
|
+
- `offset` (number, optional): Offset for pagination (default: 0)
|
|
467
430
|
|
|
468
|
-
**
|
|
469
|
-
```
|
|
470
|
-
|
|
471
|
-
|
|
431
|
+
**Response:**
|
|
432
|
+
```json
|
|
433
|
+
{
|
|
434
|
+
"messages": []
|
|
435
|
+
}
|
|
472
436
|
```
|
|
473
437
|
|
|
474
|
-
|
|
475
|
-
**Endpoint:** `GET /api/v1/analytics`
|
|
476
|
-
|
|
477
|
-
Gets analytics based on namespace or task filters.
|
|
438
|
+
**Note:** This endpoint currently has a database schema issue (`column m.status does not exist`).
|
|
478
439
|
|
|
479
|
-
**
|
|
480
|
-
- `
|
|
481
|
-
- `
|
|
440
|
+
**Status Codes:**
|
|
441
|
+
- `200`: Success
|
|
442
|
+
- `500`: Internal server error
|
|
482
443
|
|
|
483
444
|
---
|
|
484
445
|
|
|
485
|
-
###
|
|
446
|
+
### GET /api/v1/messages/:transactionId
|
|
486
447
|
|
|
487
|
-
|
|
488
|
-
**Endpoint:** `GET /api/v1/messages`
|
|
448
|
+
**Purpose:** Get details of a specific message by transaction ID.
|
|
489
449
|
|
|
490
|
-
|
|
450
|
+
**Authentication:** None
|
|
491
451
|
|
|
492
|
-
**
|
|
493
|
-
- `
|
|
494
|
-
- `partition` (string): Filter by partition name
|
|
495
|
-
- `namespace` (string): Filter by namespace
|
|
496
|
-
- `task` (string): Filter by task
|
|
497
|
-
- `status` (string): Filter by status (pending, processing, completed, failed, dead_letter)
|
|
498
|
-
- `limit` (integer): Max results (default: 100)
|
|
499
|
-
- `offset` (integer): Pagination offset (default: 0)
|
|
452
|
+
**Path Parameters:**
|
|
453
|
+
- `transactionId` (string): Message transaction ID
|
|
500
454
|
|
|
501
455
|
**Response:**
|
|
502
456
|
```json
|
|
503
457
|
{
|
|
504
|
-
"
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
"leaseExpiresAt": null
|
|
523
|
-
}
|
|
524
|
-
]
|
|
458
|
+
"id": "0199e688-1857-7462-81ea-b87975de7e95",
|
|
459
|
+
"transactionId": "0199e688-1857-7462-81ea-b4fe7532bbde",
|
|
460
|
+
"queuePath": "test-queue/Default",
|
|
461
|
+
"queue": "test-queue",
|
|
462
|
+
"partition": "Default",
|
|
463
|
+
"namespace": null,
|
|
464
|
+
"task": null,
|
|
465
|
+
"payload": {
|
|
466
|
+
"message": "Hello World"
|
|
467
|
+
},
|
|
468
|
+
"createdAt": "2025-10-15T06:21:42.865Z",
|
|
469
|
+
"queueConfig": {
|
|
470
|
+
"leaseTime": 300,
|
|
471
|
+
"retryLimit": 3,
|
|
472
|
+
"retryDelay": 1000,
|
|
473
|
+
"ttl": 3600,
|
|
474
|
+
"priority": 0
|
|
475
|
+
}
|
|
525
476
|
}
|
|
526
477
|
```
|
|
527
478
|
|
|
528
|
-
|
|
529
|
-
|
|
479
|
+
**Status Codes:**
|
|
480
|
+
- `200`: Message found
|
|
481
|
+
- `404`: Message not found
|
|
482
|
+
- `500`: Internal server error
|
|
483
|
+
|
|
484
|
+
---
|
|
530
485
|
|
|
531
|
-
|
|
486
|
+
### DELETE /api/v1/messages/:transactionId
|
|
532
487
|
|
|
533
|
-
**
|
|
488
|
+
**Purpose:** Delete a specific message by transaction ID.
|
|
534
489
|
|
|
535
|
-
|
|
536
|
-
**Endpoint:** `DELETE /api/v1/messages/:transactionId`
|
|
490
|
+
**Authentication:** None
|
|
537
491
|
|
|
538
|
-
|
|
492
|
+
**Path Parameters:**
|
|
493
|
+
- `transactionId` (string): Message transaction ID
|
|
539
494
|
|
|
540
495
|
**Response:**
|
|
541
496
|
```json
|
|
542
497
|
{
|
|
543
498
|
"deleted": true,
|
|
544
|
-
"transactionId": "
|
|
499
|
+
"transactionId": "0199e688-1857-7462-81ea-b4fe7532bbde"
|
|
545
500
|
}
|
|
546
501
|
```
|
|
547
502
|
|
|
548
|
-
|
|
549
|
-
|
|
503
|
+
**Status Codes:**
|
|
504
|
+
- `200`: Message deleted
|
|
505
|
+
- `404`: Message not found
|
|
506
|
+
- `500`: Internal server error
|
|
507
|
+
|
|
508
|
+
---
|
|
509
|
+
|
|
510
|
+
### POST /api/v1/messages/:transactionId/retry
|
|
550
511
|
|
|
551
|
-
|
|
512
|
+
**Purpose:** Retry a failed message.
|
|
513
|
+
|
|
514
|
+
**Authentication:** None
|
|
515
|
+
|
|
516
|
+
**Path Parameters:**
|
|
517
|
+
- `transactionId` (string): Message transaction ID
|
|
552
518
|
|
|
553
519
|
**Response:**
|
|
554
520
|
```json
|
|
555
521
|
{
|
|
556
522
|
"retried": true,
|
|
557
|
-
"transactionId": "
|
|
523
|
+
"transactionId": "0199e688-a908-726e-9ca2-a2a9b312684d"
|
|
558
524
|
}
|
|
559
525
|
```
|
|
560
526
|
|
|
561
|
-
|
|
562
|
-
|
|
527
|
+
**Status Codes:**
|
|
528
|
+
- `200`: Message retried
|
|
529
|
+
- `500`: Internal server error
|
|
530
|
+
|
|
531
|
+
---
|
|
532
|
+
|
|
533
|
+
### POST /api/v1/messages/:transactionId/dlq
|
|
534
|
+
|
|
535
|
+
**Purpose:** Move a message to the dead letter queue.
|
|
563
536
|
|
|
564
|
-
|
|
537
|
+
**Authentication:** None
|
|
538
|
+
|
|
539
|
+
**Path Parameters:**
|
|
540
|
+
- `transactionId` (string): Message transaction ID
|
|
565
541
|
|
|
566
542
|
**Response:**
|
|
567
543
|
```json
|
|
568
544
|
{
|
|
569
545
|
"movedToDLQ": true,
|
|
570
|
-
"transactionId": "
|
|
546
|
+
"transactionId": "0199e688-a908-726e-9ca2-a2a9b312684d"
|
|
571
547
|
}
|
|
572
548
|
```
|
|
573
549
|
|
|
574
|
-
|
|
575
|
-
|
|
550
|
+
**Status Codes:**
|
|
551
|
+
- `200`: Message moved to DLQ
|
|
552
|
+
- `500`: Internal server error
|
|
576
553
|
|
|
577
|
-
|
|
554
|
+
---
|
|
578
555
|
|
|
579
|
-
|
|
580
|
-
```json
|
|
581
|
-
{
|
|
582
|
-
"messages": [
|
|
583
|
-
{
|
|
584
|
-
"transactionId": "related-uuid",
|
|
585
|
-
"status": "completed",
|
|
586
|
-
"createdAt": "2025-10-08T05:10:00.000Z",
|
|
587
|
-
"payload": {...}
|
|
588
|
-
}
|
|
589
|
-
]
|
|
590
|
-
}
|
|
591
|
-
```
|
|
556
|
+
### GET /api/v1/messages/:transactionId/related
|
|
592
557
|
|
|
593
|
-
|
|
594
|
-
**Endpoint:** `DELETE /api/v1/queues/:queue/clear`
|
|
558
|
+
**Purpose:** Get messages related to a specific message (e.g., by trace ID).
|
|
595
559
|
|
|
596
|
-
|
|
560
|
+
**Authentication:** None
|
|
597
561
|
|
|
598
|
-
**
|
|
599
|
-
- `
|
|
562
|
+
**Path Parameters:**
|
|
563
|
+
- `transactionId` (string): Message transaction ID
|
|
600
564
|
|
|
601
565
|
**Response:**
|
|
602
566
|
```json
|
|
603
567
|
{
|
|
604
|
-
"
|
|
605
|
-
"count": 25,
|
|
606
|
-
"queue": "emails",
|
|
607
|
-
"partition": "all" // or specific partition name
|
|
568
|
+
"messages": []
|
|
608
569
|
}
|
|
609
570
|
```
|
|
610
571
|
|
|
611
|
-
|
|
572
|
+
**Note:** This endpoint currently has a database schema issue.
|
|
612
573
|
|
|
613
|
-
|
|
574
|
+
**Status Codes:**
|
|
575
|
+
- `200`: Success
|
|
576
|
+
- `500`: Internal server error
|
|
614
577
|
|
|
615
|
-
|
|
616
|
-
**Endpoint:** `GET /health`
|
|
578
|
+
---
|
|
617
579
|
|
|
618
|
-
|
|
580
|
+
### DELETE /api/v1/queues/:queue/clear
|
|
619
581
|
|
|
620
|
-
**
|
|
621
|
-
```json
|
|
622
|
-
{
|
|
623
|
-
"status": "healthy",
|
|
624
|
-
"uptime": "3600s",
|
|
625
|
-
"connections": 5,
|
|
626
|
-
"stats": {
|
|
627
|
-
"requests": 1000,
|
|
628
|
-
"messages": 5000,
|
|
629
|
-
"requestsPerSecond": "0.28",
|
|
630
|
-
"messagesPerSecond": "1.39",
|
|
631
|
-
"pool": {
|
|
632
|
-
"total": 20,
|
|
633
|
-
"idle": 15,
|
|
634
|
-
"waiting": 0
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
```
|
|
582
|
+
**Purpose:** Clear all messages from a queue or specific partition.
|
|
639
583
|
|
|
640
|
-
|
|
641
|
-
**Endpoint:** `GET /metrics`
|
|
584
|
+
**Authentication:** None
|
|
642
585
|
|
|
643
|
-
|
|
586
|
+
**Path Parameters:**
|
|
587
|
+
- `queue` (string): Queue name
|
|
588
|
+
|
|
589
|
+
**Query Parameters:**
|
|
590
|
+
- `partition` (string, optional): Partition name to clear (if omitted, clears all partitions)
|
|
644
591
|
|
|
645
592
|
**Response:**
|
|
646
593
|
```json
|
|
647
594
|
{
|
|
648
|
-
"
|
|
649
|
-
"
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
},
|
|
653
|
-
"messages": {
|
|
654
|
-
"total": 5000,
|
|
655
|
-
"rate": 1.39
|
|
656
|
-
},
|
|
657
|
-
"database": {
|
|
658
|
-
"poolSize": 20,
|
|
659
|
-
"idleConnections": 15,
|
|
660
|
-
"waitingRequests": 0
|
|
661
|
-
},
|
|
662
|
-
"memory": {
|
|
663
|
-
"rss": 104857600,
|
|
664
|
-
"heapTotal": 73728000,
|
|
665
|
-
"heapUsed": 45678900,
|
|
666
|
-
"external": 2345678,
|
|
667
|
-
"arrayBuffers": 123456
|
|
668
|
-
},
|
|
669
|
-
"cpu": {
|
|
670
|
-
"user": 1234567,
|
|
671
|
-
"system": 234567
|
|
672
|
-
}
|
|
595
|
+
"cleared": true,
|
|
596
|
+
"count": 6,
|
|
597
|
+
"queue": "test-queue",
|
|
598
|
+
"partition": "Default"
|
|
673
599
|
}
|
|
674
600
|
```
|
|
675
601
|
|
|
676
|
-
|
|
602
|
+
**Status Codes:**
|
|
603
|
+
- `200`: Queue cleared
|
|
604
|
+
- `500`: Internal server error
|
|
677
605
|
|
|
678
|
-
|
|
606
|
+
---
|
|
679
607
|
|
|
680
|
-
|
|
608
|
+
## Resource Queries
|
|
681
609
|
|
|
682
|
-
|
|
610
|
+
### GET /api/v1/resources/queues
|
|
683
611
|
|
|
684
|
-
|
|
685
|
-
**Endpoint:** `GET /api/v1/resources/queues`
|
|
612
|
+
**Purpose:** Get a list of all queues with their statistics.
|
|
686
613
|
|
|
687
|
-
|
|
614
|
+
**Authentication:** None
|
|
688
615
|
|
|
689
616
|
**Query Parameters:**
|
|
690
|
-
- `namespace` (string): Filter by namespace
|
|
691
|
-
- `task` (string): Filter by task
|
|
617
|
+
- `namespace` (string, optional): Filter by namespace
|
|
618
|
+
- `task` (string, optional): Filter by task
|
|
692
619
|
|
|
693
620
|
**Response:**
|
|
694
621
|
```json
|
|
695
622
|
{
|
|
696
623
|
"queues": [
|
|
697
624
|
{
|
|
698
|
-
"id": "
|
|
699
|
-
"name": "
|
|
625
|
+
"id": "03093457-e6f6-4e5f-869b-045a6916fdff",
|
|
626
|
+
"name": "test-queue",
|
|
700
627
|
"namespace": null,
|
|
701
628
|
"task": null,
|
|
702
|
-
"createdAt": "2025-10-
|
|
703
|
-
"partitions":
|
|
629
|
+
"createdAt": "2025-10-15T06:21:42.034Z",
|
|
630
|
+
"partitions": 1,
|
|
704
631
|
"messages": {
|
|
705
|
-
"total":
|
|
706
|
-
"pending":
|
|
707
|
-
"processing":
|
|
632
|
+
"total": 0,
|
|
633
|
+
"pending": 2,
|
|
634
|
+
"processing": 0
|
|
708
635
|
}
|
|
709
636
|
}
|
|
710
637
|
]
|
|
711
638
|
}
|
|
712
639
|
```
|
|
713
640
|
|
|
714
|
-
|
|
715
|
-
|
|
641
|
+
**Status Codes:**
|
|
642
|
+
- `200`: Success
|
|
643
|
+
- `500`: Internal server error
|
|
644
|
+
|
|
645
|
+
---
|
|
646
|
+
|
|
647
|
+
### GET /api/v1/resources/queues/:queue
|
|
716
648
|
|
|
717
|
-
|
|
649
|
+
**Purpose:** Get detailed information about a specific queue.
|
|
650
|
+
|
|
651
|
+
**Authentication:** None
|
|
652
|
+
|
|
653
|
+
**Path Parameters:**
|
|
654
|
+
- `queue` (string): Queue name
|
|
718
655
|
|
|
719
656
|
**Response:**
|
|
720
657
|
```json
|
|
721
658
|
{
|
|
722
|
-
"id": "
|
|
723
|
-
"name": "
|
|
659
|
+
"id": "03093457-e6f6-4e5f-869b-045a6916fdff",
|
|
660
|
+
"name": "test-queue",
|
|
724
661
|
"namespace": null,
|
|
725
662
|
"task": null,
|
|
726
|
-
"createdAt": "2025-10-
|
|
663
|
+
"createdAt": "2025-10-15T06:21:42.034Z",
|
|
727
664
|
"partitions": [
|
|
728
665
|
{
|
|
729
|
-
"id": "
|
|
730
|
-
"name": "
|
|
731
|
-
"
|
|
732
|
-
"options": {
|
|
733
|
-
"leaseTime": 300,
|
|
734
|
-
"retryLimit": 3
|
|
735
|
-
},
|
|
736
|
-
"createdAt": "2025-10-08T05:13:37.541Z",
|
|
666
|
+
"id": "7a30d768-7eb7-40dd-ade9-8afb20c18591",
|
|
667
|
+
"name": "Default",
|
|
668
|
+
"createdAt": "2025-10-15T06:21:42.865Z",
|
|
737
669
|
"stats": {
|
|
738
|
-
"total":
|
|
739
|
-
"pending":
|
|
740
|
-
"processing":
|
|
741
|
-
"completed":
|
|
742
|
-
"failed":
|
|
670
|
+
"total": 0,
|
|
671
|
+
"pending": 2,
|
|
672
|
+
"processing": 0,
|
|
673
|
+
"completed": 3,
|
|
674
|
+
"failed": 0,
|
|
743
675
|
"deadLetter": 0
|
|
744
676
|
},
|
|
745
|
-
"oldestMessage":
|
|
746
|
-
"newestMessage":
|
|
677
|
+
"oldestMessage": null,
|
|
678
|
+
"newestMessage": null
|
|
747
679
|
}
|
|
748
680
|
],
|
|
749
681
|
"totals": {
|
|
750
|
-
"total":
|
|
751
|
-
"pending":
|
|
752
|
-
"processing":
|
|
753
|
-
"completed":
|
|
754
|
-
"failed":
|
|
682
|
+
"total": 0,
|
|
683
|
+
"pending": 2,
|
|
684
|
+
"processing": 0,
|
|
685
|
+
"completed": 3,
|
|
686
|
+
"failed": 0,
|
|
755
687
|
"deadLetter": 0
|
|
756
688
|
}
|
|
757
689
|
}
|
|
758
690
|
```
|
|
759
691
|
|
|
760
|
-
|
|
761
|
-
|
|
692
|
+
**Status Codes:**
|
|
693
|
+
- `200`: Success
|
|
694
|
+
- `404`: Queue not found
|
|
695
|
+
- `500`: Internal server error
|
|
696
|
+
|
|
697
|
+
---
|
|
698
|
+
|
|
699
|
+
### DELETE /api/v1/resources/queues/:queue
|
|
700
|
+
|
|
701
|
+
**Purpose:** Delete a queue and all its messages.
|
|
762
702
|
|
|
763
|
-
|
|
703
|
+
**Authentication:** None
|
|
704
|
+
|
|
705
|
+
**Path Parameters:**
|
|
706
|
+
- `queue` (string): Queue name
|
|
707
|
+
|
|
708
|
+
**Response:**
|
|
709
|
+
```json
|
|
710
|
+
{
|
|
711
|
+
"deleted": true,
|
|
712
|
+
"queue": "test-queue"
|
|
713
|
+
}
|
|
714
|
+
```
|
|
715
|
+
|
|
716
|
+
**Status Codes:**
|
|
717
|
+
- `200`: Queue deleted
|
|
718
|
+
- `500`: Internal server error
|
|
719
|
+
|
|
720
|
+
---
|
|
721
|
+
|
|
722
|
+
### GET /api/v1/resources/partitions
|
|
723
|
+
|
|
724
|
+
**Purpose:** Get a list of partitions across all queues.
|
|
725
|
+
|
|
726
|
+
**Authentication:** None
|
|
764
727
|
|
|
765
728
|
**Query Parameters:**
|
|
766
|
-
- `queue` (string): Filter by queue name
|
|
767
|
-
- `minDepth` (
|
|
729
|
+
- `queue` (string, optional): Filter by queue name
|
|
730
|
+
- `minDepth` (number, optional): Filter partitions with at least this many messages
|
|
768
731
|
|
|
769
732
|
**Response:**
|
|
770
733
|
```json
|
|
771
734
|
{
|
|
772
735
|
"partitions": [
|
|
773
736
|
{
|
|
774
|
-
"id": "
|
|
775
|
-
"name": "
|
|
776
|
-
"queue": "
|
|
737
|
+
"id": "7a30d768-7eb7-40dd-ade9-8afb20c18591",
|
|
738
|
+
"name": "Default",
|
|
739
|
+
"queue": "test-queue",
|
|
777
740
|
"namespace": null,
|
|
778
741
|
"task": null,
|
|
779
|
-
"
|
|
780
|
-
"
|
|
781
|
-
"
|
|
782
|
-
"
|
|
783
|
-
"
|
|
784
|
-
"total": 50
|
|
742
|
+
"queuePriority": 0,
|
|
743
|
+
"createdAt": "2025-10-15T06:21:42.865Z",
|
|
744
|
+
"depth": 2,
|
|
745
|
+
"processing": 0,
|
|
746
|
+
"total": 0
|
|
785
747
|
}
|
|
786
748
|
]
|
|
787
749
|
}
|
|
788
750
|
```
|
|
789
751
|
|
|
790
|
-
|
|
791
|
-
|
|
752
|
+
**Status Codes:**
|
|
753
|
+
- `200`: Success
|
|
754
|
+
- `500`: Internal server error
|
|
792
755
|
|
|
793
|
-
|
|
756
|
+
---
|
|
757
|
+
|
|
758
|
+
### GET /api/v1/resources/namespaces
|
|
759
|
+
|
|
760
|
+
**Purpose:** Get a list of all namespaces with statistics.
|
|
761
|
+
|
|
762
|
+
**Authentication:** None
|
|
763
|
+
|
|
764
|
+
**Query Parameters:** None
|
|
794
765
|
|
|
795
766
|
**Response:**
|
|
796
767
|
```json
|
|
797
768
|
{
|
|
798
769
|
"namespaces": [
|
|
799
770
|
{
|
|
800
|
-
"namespace": "
|
|
801
|
-
"queues":
|
|
802
|
-
"partitions":
|
|
771
|
+
"namespace": "benchmark",
|
|
772
|
+
"queues": 51,
|
|
773
|
+
"partitions": 510,
|
|
803
774
|
"messages": {
|
|
804
|
-
"total":
|
|
805
|
-
"pending":
|
|
775
|
+
"total": 200000,
|
|
776
|
+
"pending": 0
|
|
806
777
|
}
|
|
807
778
|
}
|
|
808
779
|
]
|
|
809
780
|
}
|
|
810
781
|
```
|
|
811
782
|
|
|
812
|
-
|
|
813
|
-
|
|
783
|
+
**Status Codes:**
|
|
784
|
+
- `200`: Success
|
|
785
|
+
- `500`: Internal server error
|
|
786
|
+
|
|
787
|
+
---
|
|
788
|
+
|
|
789
|
+
### GET /api/v1/resources/tasks
|
|
790
|
+
|
|
791
|
+
**Purpose:** Get a list of all tasks with statistics.
|
|
814
792
|
|
|
815
|
-
|
|
793
|
+
**Authentication:** None
|
|
794
|
+
|
|
795
|
+
**Query Parameters:** None
|
|
816
796
|
|
|
817
797
|
**Response:**
|
|
818
798
|
```json
|
|
819
799
|
{
|
|
820
|
-
"tasks": [
|
|
821
|
-
{
|
|
822
|
-
"task": "notifications",
|
|
823
|
-
"queues": 3,
|
|
824
|
-
"partitions": 9,
|
|
825
|
-
"messages": {
|
|
826
|
-
"total": 500,
|
|
827
|
-
"pending": 100
|
|
828
|
-
}
|
|
829
|
-
}
|
|
830
|
-
]
|
|
800
|
+
"tasks": []
|
|
831
801
|
}
|
|
832
802
|
```
|
|
833
803
|
|
|
834
|
-
|
|
835
|
-
|
|
804
|
+
**Status Codes:**
|
|
805
|
+
- `200`: Success
|
|
806
|
+
- `500`: Internal server error
|
|
807
|
+
|
|
808
|
+
---
|
|
809
|
+
|
|
810
|
+
### GET /api/v1/resources/overview
|
|
836
811
|
|
|
837
|
-
|
|
812
|
+
**Purpose:** Get a comprehensive system overview with all statistics.
|
|
813
|
+
|
|
814
|
+
**Authentication:** None
|
|
815
|
+
|
|
816
|
+
**Query Parameters:** None
|
|
838
817
|
|
|
839
818
|
**Response:**
|
|
840
819
|
```json
|
|
841
820
|
{
|
|
842
|
-
"queues":
|
|
843
|
-
"partitions":
|
|
844
|
-
"namespaces":
|
|
845
|
-
"tasks":
|
|
821
|
+
"queues": 53,
|
|
822
|
+
"partitions": 512,
|
|
823
|
+
"namespaces": 1,
|
|
824
|
+
"tasks": 0,
|
|
846
825
|
"messages": {
|
|
847
|
-
"total":
|
|
848
|
-
"pending":
|
|
849
|
-
"processing":
|
|
850
|
-
"completed":
|
|
851
|
-
"failed":
|
|
852
|
-
"deadLetter":
|
|
826
|
+
"total": 200000,
|
|
827
|
+
"pending": 2,
|
|
828
|
+
"processing": 0,
|
|
829
|
+
"completed": 16493,
|
|
830
|
+
"failed": 0,
|
|
831
|
+
"deadLetter": 0
|
|
853
832
|
},
|
|
854
|
-
"timestamp": "2025-10-
|
|
833
|
+
"timestamp": "2025-10-15T06:22:38.014Z"
|
|
855
834
|
}
|
|
856
835
|
```
|
|
857
836
|
|
|
837
|
+
**Status Codes:**
|
|
838
|
+
- `200`: Success
|
|
839
|
+
- `500`: Internal server error
|
|
840
|
+
|
|
858
841
|
---
|
|
859
842
|
|
|
860
|
-
##
|
|
843
|
+
## Status & Analytics
|
|
861
844
|
|
|
862
|
-
###
|
|
863
|
-
**Endpoint:** `ws://localhost:6632/ws/dashboard`
|
|
845
|
+
### GET /api/v1/status
|
|
864
846
|
|
|
865
|
-
|
|
847
|
+
**Purpose:** Get comprehensive dashboard status including throughput metrics and message statistics.
|
|
866
848
|
|
|
867
|
-
|
|
868
|
-
```javascript
|
|
869
|
-
const ws = new WebSocket('ws://localhost:6632/ws/dashboard');
|
|
849
|
+
**Authentication:** None
|
|
870
850
|
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
type: 'subscribe',
|
|
878
|
-
queues: ['emails', 'payments']
|
|
879
|
-
}));
|
|
880
|
-
};
|
|
881
|
-
```
|
|
882
|
-
|
|
883
|
-
#### Events (Server → Client)
|
|
851
|
+
**Query Parameters:**
|
|
852
|
+
- `from` (string, optional): Start date/time (ISO 8601)
|
|
853
|
+
- `to` (string, optional): End date/time (ISO 8601)
|
|
854
|
+
- `queue` (string, optional): Filter by queue name
|
|
855
|
+
- `namespace` (string, optional): Filter by namespace
|
|
856
|
+
- `task` (string, optional): Filter by task
|
|
884
857
|
|
|
885
|
-
**
|
|
858
|
+
**Response:**
|
|
886
859
|
```json
|
|
887
860
|
{
|
|
888
|
-
"
|
|
889
|
-
|
|
890
|
-
"
|
|
891
|
-
|
|
861
|
+
"timeRange": {
|
|
862
|
+
"from": "2025-10-15T05:22:39.466Z",
|
|
863
|
+
"to": "2025-10-15T06:22:39.466Z"
|
|
864
|
+
},
|
|
865
|
+
"throughput": [
|
|
866
|
+
{
|
|
867
|
+
"timestamp": "2025-10-15T06:22:00.000Z",
|
|
868
|
+
"ingested": 0,
|
|
869
|
+
"processed": 0,
|
|
870
|
+
"ingestedPerSecond": 0,
|
|
871
|
+
"processedPerSecond": 0
|
|
872
|
+
}
|
|
873
|
+
],
|
|
874
|
+
"queues": [],
|
|
875
|
+
"messages": {
|
|
876
|
+
"total": 0,
|
|
877
|
+
"pending": 2,
|
|
878
|
+
"processing": 0,
|
|
879
|
+
"completed": 16493,
|
|
880
|
+
"failed": 0,
|
|
881
|
+
"deadLetter": 0
|
|
882
|
+
},
|
|
883
|
+
"leases": {
|
|
884
|
+
"active": 0,
|
|
885
|
+
"partitionsWithLeases": 0,
|
|
886
|
+
"totalBatchSize": 0,
|
|
887
|
+
"totalAcked": 0
|
|
892
888
|
},
|
|
893
|
-
"
|
|
889
|
+
"deadLetterQueue": {
|
|
890
|
+
"totalMessages": 0,
|
|
891
|
+
"affectedPartitions": 0,
|
|
892
|
+
"topErrors": []
|
|
893
|
+
}
|
|
894
894
|
}
|
|
895
895
|
```
|
|
896
896
|
|
|
897
|
-
**
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
{
|
|
901
|
-
"event": "message.pushed",
|
|
902
|
-
"data": {
|
|
903
|
-
"queue": "emails",
|
|
904
|
-
"partition": "urgent",
|
|
905
|
-
"transactionId": "uuid"
|
|
906
|
-
},
|
|
907
|
-
"timestamp": "2025-10-08T07:30:00.000Z"
|
|
908
|
-
}
|
|
897
|
+
**Status Codes:**
|
|
898
|
+
- `200`: Success
|
|
899
|
+
- `500`: Internal server error
|
|
909
900
|
|
|
910
|
-
|
|
911
|
-
{
|
|
912
|
-
"event": "message.processing",
|
|
913
|
-
"data": {
|
|
914
|
-
"queue": "emails",
|
|
915
|
-
"partition": "urgent",
|
|
916
|
-
"transactionId": "uuid",
|
|
917
|
-
"workerId": "worker-123"
|
|
918
|
-
},
|
|
919
|
-
"timestamp": "2025-10-08T07:30:00.000Z"
|
|
920
|
-
}
|
|
901
|
+
---
|
|
921
902
|
|
|
922
|
-
|
|
923
|
-
{
|
|
924
|
-
"event": "message.completed",
|
|
925
|
-
"data": {
|
|
926
|
-
"transactionId": "uuid"
|
|
927
|
-
},
|
|
928
|
-
"timestamp": "2025-10-08T07:30:00.000Z"
|
|
929
|
-
}
|
|
903
|
+
### GET /api/v1/status/queues
|
|
930
904
|
|
|
931
|
-
|
|
932
|
-
{
|
|
933
|
-
"event": "message.failed",
|
|
934
|
-
"data": {
|
|
935
|
-
"transactionId": "uuid",
|
|
936
|
-
"error": "Processing error"
|
|
937
|
-
},
|
|
938
|
-
"timestamp": "2025-10-08T07:30:00.000Z"
|
|
939
|
-
}
|
|
940
|
-
```
|
|
905
|
+
**Purpose:** Get a list of queues with detailed status information.
|
|
941
906
|
|
|
942
|
-
**
|
|
907
|
+
**Authentication:** None
|
|
908
|
+
|
|
909
|
+
**Query Parameters:**
|
|
910
|
+
- `from` (string, optional): Start date/time
|
|
911
|
+
- `to` (string, optional): End date/time
|
|
912
|
+
- `namespace` (string, optional): Filter by namespace
|
|
913
|
+
- `task` (string, optional): Filter by task
|
|
914
|
+
- `limit` (number, optional): Number of results
|
|
915
|
+
- `offset` (number, optional): Pagination offset
|
|
916
|
+
|
|
917
|
+
**Response:**
|
|
943
918
|
```json
|
|
944
|
-
// Queue created
|
|
945
919
|
{
|
|
946
|
-
"
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
920
|
+
"queues": [
|
|
921
|
+
{
|
|
922
|
+
"id": "a6447f65-6c44-423e-a9b7-440fd7136d35",
|
|
923
|
+
"name": "__system_events__",
|
|
924
|
+
"namespace": null,
|
|
925
|
+
"task": null,
|
|
926
|
+
"priority": 100,
|
|
927
|
+
"createdAt": "2025-10-14T12:45:32.356Z",
|
|
928
|
+
"partitions": 1,
|
|
929
|
+
"messages": {
|
|
930
|
+
"total": 0,
|
|
931
|
+
"pending": 0,
|
|
932
|
+
"processing": 0,
|
|
933
|
+
"completed": 0,
|
|
934
|
+
"failed": 0,
|
|
935
|
+
"deadLetter": 0
|
|
936
|
+
},
|
|
937
|
+
"lag": null,
|
|
938
|
+
"performance": null
|
|
939
|
+
}
|
|
940
|
+
]
|
|
952
941
|
}
|
|
942
|
+
```
|
|
943
|
+
|
|
944
|
+
**Status Codes:**
|
|
945
|
+
- `200`: Success
|
|
946
|
+
- `500`: Internal server error
|
|
947
|
+
|
|
948
|
+
---
|
|
949
|
+
|
|
950
|
+
### GET /api/v1/status/queues/:queue
|
|
951
|
+
|
|
952
|
+
**Purpose:** Get detailed status information for a specific queue.
|
|
953
953
|
|
|
954
|
-
|
|
954
|
+
**Authentication:** None
|
|
955
|
+
|
|
956
|
+
**Path Parameters:**
|
|
957
|
+
- `queue` (string): Queue name
|
|
958
|
+
|
|
959
|
+
**Query Parameters:**
|
|
960
|
+
- `from` (string, optional): Start date/time
|
|
961
|
+
- `to` (string, optional): End date/time
|
|
962
|
+
|
|
963
|
+
**Response:**
|
|
964
|
+
```json
|
|
955
965
|
{
|
|
956
|
-
"
|
|
957
|
-
|
|
958
|
-
"
|
|
966
|
+
"queue": {
|
|
967
|
+
"id": "03093457-e6f6-4e5f-869b-045a6916fdff",
|
|
968
|
+
"name": "test-queue",
|
|
959
969
|
"namespace": null,
|
|
960
970
|
"task": null,
|
|
961
|
-
"
|
|
962
|
-
"
|
|
963
|
-
|
|
964
|
-
"
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
971
|
+
"priority": 0,
|
|
972
|
+
"config": {
|
|
973
|
+
"leaseTime": 300,
|
|
974
|
+
"retryLimit": 3,
|
|
975
|
+
"ttl": 3600,
|
|
976
|
+
"maxQueueSize": 0
|
|
977
|
+
},
|
|
978
|
+
"createdAt": "2025-10-15T06:21:42.034Z"
|
|
979
|
+
},
|
|
980
|
+
"totals": {
|
|
981
|
+
"messages": {
|
|
982
|
+
"total": 0,
|
|
983
|
+
"pending": 0,
|
|
984
|
+
"processing": 0,
|
|
985
|
+
"completed": 3,
|
|
986
|
+
"failed": 0
|
|
987
|
+
},
|
|
988
|
+
"partitions": 1,
|
|
989
|
+
"consumed": 3,
|
|
990
|
+
"batches": 2
|
|
991
|
+
},
|
|
992
|
+
"partitions": [
|
|
993
|
+
{
|
|
994
|
+
"id": "7a30d768-7eb7-40dd-ade9-8afb20c18591",
|
|
995
|
+
"name": "Default",
|
|
996
|
+
"createdAt": "2025-10-15T06:21:42.865Z",
|
|
997
|
+
"lastActivity": "2025-10-15T06:22:21.725Z",
|
|
998
|
+
"messages": {
|
|
999
|
+
"total": 0,
|
|
1000
|
+
"pending": 0,
|
|
1001
|
+
"processing": 0,
|
|
1002
|
+
"completed": 3,
|
|
1003
|
+
"failed": 0
|
|
969
1004
|
},
|
|
970
|
-
"
|
|
971
|
-
"
|
|
972
|
-
"
|
|
973
|
-
"
|
|
974
|
-
"failed": 2
|
|
1005
|
+
"cursor": {
|
|
1006
|
+
"totalConsumed": 3,
|
|
1007
|
+
"batchesConsumed": 2,
|
|
1008
|
+
"lastConsumedAt": "2025-10-15T06:22:10.537Z"
|
|
975
1009
|
}
|
|
976
1010
|
}
|
|
977
|
-
|
|
978
|
-
"
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
{
|
|
983
|
-
"event": "partition.depth",
|
|
984
|
-
"data": {
|
|
985
|
-
"queue": "emails",
|
|
986
|
-
"partition": "urgent",
|
|
987
|
-
"depth": 15,
|
|
988
|
-
"processing": 3,
|
|
989
|
-
"completed": 50,
|
|
990
|
-
"failed": 2,
|
|
991
|
-
"total": 70
|
|
992
|
-
},
|
|
993
|
-
"timestamp": "2025-10-08T07:30:00.000Z"
|
|
1011
|
+
],
|
|
1012
|
+
"timeRange": {
|
|
1013
|
+
"from": "2025-10-15T05:22:47.435Z",
|
|
1014
|
+
"to": "2025-10-15T06:22:47.435Z"
|
|
1015
|
+
}
|
|
994
1016
|
}
|
|
995
1017
|
```
|
|
996
1018
|
|
|
997
|
-
**
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
"event": "system.stats",
|
|
1002
|
-
"data": {
|
|
1003
|
-
"pending": 200,
|
|
1004
|
-
"processing": 50,
|
|
1005
|
-
"recentCreated": 120, // Last minute
|
|
1006
|
-
"recentCompleted": 115, // Last minute
|
|
1007
|
-
"connections": 5 // WebSocket connections
|
|
1008
|
-
},
|
|
1009
|
-
"timestamp": "2025-10-08T07:30:00.000Z"
|
|
1010
|
-
}
|
|
1019
|
+
**Status Codes:**
|
|
1020
|
+
- `200`: Success
|
|
1021
|
+
- `404`: Queue not found
|
|
1022
|
+
- `500`: Internal server error
|
|
1011
1023
|
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1024
|
+
---
|
|
1025
|
+
|
|
1026
|
+
### GET /api/v1/status/queues/:queue/messages
|
|
1027
|
+
|
|
1028
|
+
**Purpose:** Get messages from a specific queue with filtering and pagination.
|
|
1029
|
+
|
|
1030
|
+
**Authentication:** None
|
|
1031
|
+
|
|
1032
|
+
**Path Parameters:**
|
|
1033
|
+
- `queue` (string): Queue name
|
|
1020
1034
|
|
|
1021
|
-
|
|
1035
|
+
**Query Parameters:**
|
|
1036
|
+
- `status` (string, optional): Filter by message status
|
|
1037
|
+
- `partition` (string, optional): Filter by partition
|
|
1038
|
+
- `from` (string, optional): Start date/time
|
|
1039
|
+
- `to` (string, optional): End date/time
|
|
1040
|
+
- `limit` (number, optional): Number of results
|
|
1041
|
+
- `offset` (number, optional): Pagination offset
|
|
1042
|
+
|
|
1043
|
+
**Response:**
|
|
1044
|
+
```json
|
|
1022
1045
|
{
|
|
1023
|
-
"
|
|
1024
|
-
"
|
|
1025
|
-
"
|
|
1046
|
+
"messages": [],
|
|
1047
|
+
"pagination": {
|
|
1048
|
+
"limit": 2,
|
|
1049
|
+
"offset": null,
|
|
1050
|
+
"total": 0
|
|
1026
1051
|
},
|
|
1027
|
-
"
|
|
1052
|
+
"queue": "test-queue",
|
|
1053
|
+
"filters": {
|
|
1054
|
+
"status": null,
|
|
1055
|
+
"partition": null
|
|
1056
|
+
},
|
|
1057
|
+
"timeRange": {
|
|
1058
|
+
"from": "2025-10-15T05:22:48.221Z",
|
|
1059
|
+
"to": "2025-10-15T06:22:48.221Z"
|
|
1060
|
+
}
|
|
1028
1061
|
}
|
|
1029
1062
|
```
|
|
1030
1063
|
|
|
1031
|
-
|
|
1064
|
+
**Status Codes:**
|
|
1065
|
+
- `200`: Success
|
|
1066
|
+
- `500`: Internal server error
|
|
1067
|
+
|
|
1068
|
+
---
|
|
1032
1069
|
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1070
|
+
### GET /api/v1/status/analytics
|
|
1071
|
+
|
|
1072
|
+
**Purpose:** Get analytics data including time series metrics.
|
|
1073
|
+
|
|
1074
|
+
**Authentication:** None
|
|
1038
1075
|
|
|
1039
|
-
**
|
|
1076
|
+
**Query Parameters:**
|
|
1077
|
+
- `from` (string, optional): Start date/time
|
|
1078
|
+
- `to` (string, optional): End date/time
|
|
1079
|
+
- `queue` (string, optional): Filter by queue
|
|
1080
|
+
- `namespace` (string, optional): Filter by namespace
|
|
1081
|
+
- `task` (string, optional): Filter by task
|
|
1082
|
+
- `interval` (string, optional): Time interval: "minute", "hour", "day" (default: "hour")
|
|
1083
|
+
|
|
1084
|
+
**Response:**
|
|
1040
1085
|
```json
|
|
1041
1086
|
{
|
|
1042
|
-
"
|
|
1043
|
-
|
|
1087
|
+
"timeRange": {
|
|
1088
|
+
"from": "2025-10-15T05:22:50.000Z",
|
|
1089
|
+
"to": "2025-10-15T06:22:50.000Z"
|
|
1090
|
+
},
|
|
1091
|
+
"interval": "hour",
|
|
1092
|
+
"timeSeries": [],
|
|
1093
|
+
"summary": null
|
|
1044
1094
|
}
|
|
1045
1095
|
```
|
|
1046
1096
|
|
|
1047
|
-
**
|
|
1097
|
+
**Status Codes:**
|
|
1098
|
+
- `200`: Success
|
|
1099
|
+
- `500`: Internal server error
|
|
1048
1100
|
|
|
1049
1101
|
---
|
|
1050
1102
|
|
|
1051
1103
|
## Error Responses
|
|
1052
1104
|
|
|
1053
|
-
All endpoints may return error responses:
|
|
1105
|
+
All endpoints may return error responses in the following format:
|
|
1054
1106
|
|
|
1055
1107
|
```json
|
|
1056
1108
|
{
|
|
@@ -1058,59 +1110,117 @@ All endpoints may return error responses:
|
|
|
1058
1110
|
}
|
|
1059
1111
|
```
|
|
1060
1112
|
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
- `
|
|
1064
|
-
- `
|
|
1065
|
-
- `
|
|
1066
|
-
- `
|
|
1067
|
-
- `
|
|
1068
|
-
- `
|
|
1113
|
+
### Common Status Codes:
|
|
1114
|
+
|
|
1115
|
+
- `200 OK`: Request successful
|
|
1116
|
+
- `201 Created`: Resource created successfully
|
|
1117
|
+
- `204 No Content`: Request successful but no content to return
|
|
1118
|
+
- `400 Bad Request`: Invalid request parameters or body
|
|
1119
|
+
- `404 Not Found`: Resource not found
|
|
1120
|
+
- `500 Internal Server Error`: Server error
|
|
1121
|
+
- `503 Service Unavailable`: Server is unhealthy or unavailable
|
|
1069
1122
|
|
|
1070
1123
|
---
|
|
1071
1124
|
|
|
1072
|
-
##
|
|
1125
|
+
## WebSocket API
|
|
1073
1126
|
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1127
|
+
Queen also provides a WebSocket connection for real-time updates:
|
|
1128
|
+
|
|
1129
|
+
**WebSocket URL:** `ws://localhost:6632/ws/dashboard`
|
|
1130
|
+
|
|
1131
|
+
**Purpose:** Real-time updates for:
|
|
1132
|
+
- Queue depth changes
|
|
1133
|
+
- Message events (pushed, processing, completed, failed)
|
|
1134
|
+
- System statistics
|
|
1079
1135
|
|
|
1080
1136
|
---
|
|
1081
1137
|
|
|
1082
|
-
##
|
|
1138
|
+
## Notes
|
|
1083
1139
|
|
|
1084
|
-
|
|
1085
|
-
// 1. Push a message
|
|
1086
|
-
POST /api/v1/push
|
|
1087
|
-
{
|
|
1088
|
-
"items": [{
|
|
1089
|
-
"queue": "orders",
|
|
1090
|
-
"partition": "high-priority",
|
|
1091
|
-
"payload": { "orderId": "12345", "amount": 99.99 }
|
|
1092
|
-
}]
|
|
1093
|
-
}
|
|
1140
|
+
1. **CORS**: All endpoints support CORS with permissive settings. In production, configure appropriate CORS settings.
|
|
1094
1141
|
|
|
1095
|
-
|
|
1096
|
-
GET /api/v1/pop/queue/orders/partition/high-priority
|
|
1142
|
+
2. **Pagination**: Most list endpoints support pagination via `limit` and `offset` query parameters.
|
|
1097
1143
|
|
|
1098
|
-
|
|
1144
|
+
3. **Time Ranges**: Status and analytics endpoints default to the last 1 hour if no time range is specified.
|
|
1099
1145
|
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1146
|
+
4. **Consumer Groups**: Queen supports consumer groups for subscription-based message consumption, enabling multiple consumers to process messages in parallel without duplication.
|
|
1147
|
+
|
|
1148
|
+
5. **Partitions**: Messages can be organized into partitions for better parallelism and ordering guarantees within partitions.
|
|
1149
|
+
|
|
1150
|
+
6. **Namespaces and Tasks**: Optional organizational features for grouping queues logically.
|
|
1151
|
+
|
|
1152
|
+
7. **Dead Letter Queue (DLQ)**: Failed messages can be moved to a DLQ for later analysis and reprocessing.
|
|
1153
|
+
|
|
1154
|
+
8. **Encryption**: Encryption can be enabled by setting the `QUEEN_ENCRYPTION_KEY` environment variable.
|
|
1155
|
+
|
|
1156
|
+
---
|
|
1157
|
+
|
|
1158
|
+
## Examples
|
|
1159
|
+
|
|
1160
|
+
### Creating a Queue and Sending Messages
|
|
1161
|
+
|
|
1162
|
+
```bash
|
|
1163
|
+
# 1. Create a queue
|
|
1164
|
+
curl -X POST http://localhost:6632/api/v1/configure \
|
|
1165
|
+
-H "Content-Type: application/json" \
|
|
1166
|
+
-d '{
|
|
1167
|
+
"queue": "my-queue",
|
|
1168
|
+
"partition": "Default",
|
|
1169
|
+
"ttl": 3600,
|
|
1170
|
+
"priority": 1
|
|
1171
|
+
}'
|
|
1172
|
+
|
|
1173
|
+
# 2. Push messages
|
|
1174
|
+
curl -X POST http://localhost:6632/api/v1/push \
|
|
1175
|
+
-H "Content-Type: application/json" \
|
|
1176
|
+
-d '{
|
|
1177
|
+
"items": [
|
|
1178
|
+
{
|
|
1179
|
+
"queue": "my-queue",
|
|
1180
|
+
"partition": "Default",
|
|
1181
|
+
"payload": {"task": "process-order", "orderId": 123}
|
|
1182
|
+
}
|
|
1183
|
+
]
|
|
1184
|
+
}'
|
|
1185
|
+
|
|
1186
|
+
# 3. Pop messages
|
|
1187
|
+
curl "http://localhost:6632/api/v1/pop/queue/my-queue?batch=10"
|
|
1188
|
+
|
|
1189
|
+
# 4. Acknowledge message
|
|
1190
|
+
curl -X POST http://localhost:6632/api/v1/ack \
|
|
1191
|
+
-H "Content-Type: application/json" \
|
|
1192
|
+
-d '{
|
|
1193
|
+
"transactionId": "<transaction-id-from-pop>",
|
|
1194
|
+
"status": "completed"
|
|
1195
|
+
}'
|
|
1196
|
+
```
|
|
1197
|
+
|
|
1198
|
+
### Long Polling
|
|
1199
|
+
|
|
1200
|
+
```bash
|
|
1201
|
+
# Wait up to 30 seconds for messages
|
|
1202
|
+
curl "http://localhost:6632/api/v1/pop/queue/my-queue?wait=true&timeout=30000&batch=10"
|
|
1203
|
+
```
|
|
1204
|
+
|
|
1205
|
+
### Subscription Mode (Consumer Groups)
|
|
1206
|
+
|
|
1207
|
+
```bash
|
|
1208
|
+
# Subscribe from earliest message
|
|
1209
|
+
curl "http://localhost:6632/api/v1/pop/queue/my-queue?consumerGroup=worker-group-1&subscriptionMode=earliest&batch=10"
|
|
1210
|
+
|
|
1211
|
+
# Acknowledge for consumer group
|
|
1212
|
+
curl -X POST http://localhost:6632/api/v1/ack \
|
|
1213
|
+
-H "Content-Type: application/json" \
|
|
1214
|
+
-d '{
|
|
1215
|
+
"transactionId": "<transaction-id>",
|
|
1216
|
+
"status": "completed",
|
|
1217
|
+
"consumerGroup": "worker-group-1"
|
|
1218
|
+
}'
|
|
1106
1219
|
```
|
|
1107
1220
|
|
|
1108
1221
|
---
|
|
1109
1222
|
|
|
1110
|
-
|
|
1223
|
+
**Last Updated:** October 15, 2025
|
|
1224
|
+
**API Version:** v1
|
|
1225
|
+
**Server Version:** Queen Message Queue
|
|
1111
1226
|
|
|
1112
|
-
All endpoints include CORS headers:
|
|
1113
|
-
- `Access-Control-Allow-Origin: *`
|
|
1114
|
-
- `Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS`
|
|
1115
|
-
- `Access-Control-Allow-Headers: Content-Type, Authorization`
|
|
1116
|
-
- `Access-Control-Max-Age: 86400`
|