queen-mq 0.1.0
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 +1116 -0
- package/CACHE.md +519 -0
- package/DASHBOARD-V3.md +478 -0
- package/DASHBOARD.md +382 -0
- package/MOD_QUEUE.md +453 -0
- package/PARTITION_LOCKING_DESIGN.md +989 -0
- package/PLAN.md +707 -0
- package/QUERY_ANALSYS.md +72 -0
- package/QUEUE_BUS.md +334 -0
- package/README.md +1495 -0
- package/V2-PLAN.md +236 -0
- package/assets/dashboard.png +0 -0
- package/dashboard/.vscode/extensions.json +3 -0
- package/dashboard/README.md +5 -0
- package/dashboard/index.html +14 -0
- package/dashboard/package-lock.json +1458 -0
- package/dashboard/package.json +25 -0
- package/dashboard/public/vite.svg +1 -0
- package/dashboard/src/App.vue +29 -0
- package/dashboard/src/assets/styles/main.css +908 -0
- package/dashboard/src/assets/vue.svg +1 -0
- package/dashboard/src/components/cards/MetricCard.vue +298 -0
- package/dashboard/src/components/charts/QueueDepthChart.vue +276 -0
- package/dashboard/src/components/charts/QueueLagChart.vue +436 -0
- package/dashboard/src/components/charts/ThroughputChart.vue +302 -0
- package/dashboard/src/components/common/ActivityFeed.vue +251 -0
- package/dashboard/src/components/layout/AppHeader.vue +208 -0
- package/dashboard/src/components/layout/AppLayout.vue +88 -0
- package/dashboard/src/components/layout/AppSidebar.vue +261 -0
- package/dashboard/src/main.js +44 -0
- package/dashboard/src/router.js +54 -0
- package/dashboard/src/services/api.js +187 -0
- package/dashboard/src/services/websocket.js +167 -0
- package/dashboard/src/utils/constants.js +56 -0
- package/dashboard/src/utils/helpers.js +118 -0
- package/dashboard/src/views/Analytics.vue +912 -0
- package/dashboard/src/views/Dashboard.vue +906 -0
- package/dashboard/src/views/Messages.vue +437 -0
- package/dashboard/src/views/QueueDetail.vue +501 -0
- package/dashboard/src/views/Queues.vue +333 -0
- package/dashboard/vite.config.js +30 -0
- package/debug-namespace.js +110 -0
- package/docs/long-polling.md +159 -0
- package/docs/multi-server-cache-solutions.md +185 -0
- package/docs/performance-tuning.md +222 -0
- package/examples/bus-mode.js +239 -0
- package/examples/continuous-consumer-optimized.js +215 -0
- package/examples/continuous-consumer.js +159 -0
- package/examples/continuous-producer.js +343 -0
- package/examples/mixed-mode.js +277 -0
- package/examples/multi-server-test.js +305 -0
- package/examples/single.js +64 -0
- package/examples/smartchat-dealyed.js +42 -0
- package/examples/smartchat.js +52 -0
- package/examples/test-cache-invalidation.js +119 -0
- package/examples/test-cache-multi-server.js +245 -0
- package/examples/test-minimal-client.js +112 -0
- package/examples/test-queue-creation-policy.js +137 -0
- package/init-db.js +20 -0
- package/package.json +36 -0
- package/src/client/client.js +291 -0
- package/src/client/index.js +6 -0
- package/src/client/queenClient.js +513 -0
- package/src/client/utils/http.js +172 -0
- package/src/client/utils/loadBalancer.js +152 -0
- package/src/client/utils/retry.js +35 -0
- package/src/config.js +215 -0
- package/src/database/connection.js +103 -0
- package/src/database/poolManager.js +192 -0
- package/src/database/schema-v2.sql +214 -0
- package/src/managers/eventManager.js +59 -0
- package/src/managers/queueManagerOptimized.js +1512 -0
- package/src/managers/resourceCache.js +96 -0
- package/src/managers/systemEventManager.js +127 -0
- package/src/routes/ack.js +26 -0
- package/src/routes/analytics.js +812 -0
- package/src/routes/configure.js +46 -0
- package/src/routes/messages.js +298 -0
- package/src/routes/pop.js +85 -0
- package/src/routes/push.js +28 -0
- package/src/routes/resources.js +296 -0
- package/src/server.js +1286 -0
- package/src/services/encryptionService.js +82 -0
- package/src/services/evictionService.js +131 -0
- package/src/services/retentionService.js +129 -0
- package/src/services/startupSync.js +35 -0
- package/src/test/test.js +4521 -0
- package/src/utils/logger.js +44 -0
- package/src/utils/uuid.js +5 -0
- package/src/websocket/wsServer.js +221 -0
package/DASHBOARD.md
ADDED
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
# Queen Dashboard - Frontend Development Plan
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
A modern, responsive web dashboard for the Queen V2 message queue system, built with Vue 3, PrimeVue, and Vite. The dashboard provides real-time monitoring, resource management, and analytics capabilities.
|
|
5
|
+
|
|
6
|
+
## Technology Stack
|
|
7
|
+
- **Framework**: Vue 3 (Composition API)
|
|
8
|
+
- **UI Library**: PrimeVue 4.x
|
|
9
|
+
- **Build Tool**: Vite
|
|
10
|
+
- **Module System**: ESM
|
|
11
|
+
- **Styling**: PrimeVue themes + custom CSS
|
|
12
|
+
- **Charts**: Chart.js with PrimeVue Chart component
|
|
13
|
+
- **HTTP Client**: Native fetch API
|
|
14
|
+
- **WebSocket**: Native WebSocket API
|
|
15
|
+
- **State Management**: Vue 3 reactive/ref (no Vuex needed for this scale)
|
|
16
|
+
- **Routing**: Vue Router 4
|
|
17
|
+
- **Icons**: PrimeIcons
|
|
18
|
+
- **Date Handling**: Native JavaScript Date + Intl API
|
|
19
|
+
|
|
20
|
+
## Project Structure
|
|
21
|
+
```
|
|
22
|
+
dashboard/
|
|
23
|
+
├── index.html
|
|
24
|
+
├── package.json
|
|
25
|
+
├── vite.config.js
|
|
26
|
+
├── public/
|
|
27
|
+
│ └── favicon.ico
|
|
28
|
+
└── src/
|
|
29
|
+
├── main.js # App entry point
|
|
30
|
+
├── App.vue # Root component
|
|
31
|
+
├── router.js # Route definitions
|
|
32
|
+
├── assets/
|
|
33
|
+
│ └── styles/
|
|
34
|
+
│ ├── main.css # Global styles
|
|
35
|
+
│ └── variables.css # CSS variables
|
|
36
|
+
├── components/
|
|
37
|
+
│ ├── layout/
|
|
38
|
+
│ │ ├── AppHeader.vue # Top navigation bar
|
|
39
|
+
│ │ ├── AppSidebar.vue # Side navigation
|
|
40
|
+
│ │ └── AppLayout.vue # Main layout wrapper
|
|
41
|
+
│ ├── charts/
|
|
42
|
+
│ │ ├── ThroughputChart.vue # Real-time throughput
|
|
43
|
+
│ │ ├── QueueDepthChart.vue # Queue depths over time
|
|
44
|
+
│ │ ├── MessageStatusChart.vue # Message status distribution
|
|
45
|
+
│ │ └── LatencyChart.vue # Processing latency
|
|
46
|
+
│ ├── cards/
|
|
47
|
+
│ │ ├── MetricCard.vue # Single metric display
|
|
48
|
+
│ │ ├── QueueCard.vue # Queue summary card
|
|
49
|
+
│ │ └── SystemHealthCard.vue # System health indicator
|
|
50
|
+
│ └── common/
|
|
51
|
+
│ ├── DataTable.vue # Reusable data table
|
|
52
|
+
│ ├── LoadingSpinner.vue # Loading indicator
|
|
53
|
+
│ └── ErrorMessage.vue # Error display
|
|
54
|
+
├── views/
|
|
55
|
+
│ ├── Dashboard.vue # Main dashboard
|
|
56
|
+
│ ├── Queues.vue # Queue management
|
|
57
|
+
│ ├── QueueDetail.vue # Single queue details
|
|
58
|
+
│ ├── Partitions.vue # Partition management
|
|
59
|
+
│ ├── Analytics.vue # Analytics & metrics
|
|
60
|
+
│ ├── Messages.vue # Message browser
|
|
61
|
+
│ └── System.vue # System overview
|
|
62
|
+
├── services/
|
|
63
|
+
│ ├── api.js # API client
|
|
64
|
+
│ ├── websocket.js # WebSocket manager
|
|
65
|
+
│ └── formatter.js # Data formatters
|
|
66
|
+
└── utils/
|
|
67
|
+
├── constants.js # App constants
|
|
68
|
+
├── colors.js # Chart colors
|
|
69
|
+
└── helpers.js # Utility functions
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Core Features
|
|
73
|
+
|
|
74
|
+
### 1. Dashboard View
|
|
75
|
+
**Purpose**: Real-time system overview and key metrics
|
|
76
|
+
|
|
77
|
+
**Components**:
|
|
78
|
+
- **System Health Card**: Connection status, uptime, active connections
|
|
79
|
+
- **Message Metrics Cards**:
|
|
80
|
+
- Total messages (with trend)
|
|
81
|
+
- Pending messages
|
|
82
|
+
- Processing messages
|
|
83
|
+
- Completed today
|
|
84
|
+
- Failed today
|
|
85
|
+
- Messages/second rate
|
|
86
|
+
- **Throughput Chart**: Line chart showing incoming/completed/failed rates over last hour
|
|
87
|
+
- **Queue Depth Chart**: Stacked bar chart of top 10 queues by depth
|
|
88
|
+
- **Recent Activity Feed**: Live feed of recent message events via WebSocket
|
|
89
|
+
- **Quick Actions**: Buttons for common tasks
|
|
90
|
+
|
|
91
|
+
**Data Sources**:
|
|
92
|
+
- `/health` - System health
|
|
93
|
+
- `/api/v1/analytics/throughput` - Throughput metrics
|
|
94
|
+
- `/api/v1/analytics/queue-depths` - Queue depths
|
|
95
|
+
- `/api/v1/resources/overview` - System overview
|
|
96
|
+
- WebSocket events for real-time updates
|
|
97
|
+
|
|
98
|
+
### 2. Resource Management
|
|
99
|
+
|
|
100
|
+
#### 2.1 Queues View
|
|
101
|
+
**Purpose**: Manage and monitor all queues
|
|
102
|
+
|
|
103
|
+
**Features**:
|
|
104
|
+
- **Queue List Table**:
|
|
105
|
+
- Queue name
|
|
106
|
+
- Namespace/Task tags
|
|
107
|
+
- Partition count
|
|
108
|
+
- Total messages
|
|
109
|
+
- Pending/Processing counts
|
|
110
|
+
- Created date
|
|
111
|
+
- Actions (View, Configure, Clear)
|
|
112
|
+
- **Filters**: By namespace, task, or search
|
|
113
|
+
- **Sorting**: By name, depth, created date
|
|
114
|
+
- **Bulk Actions**: Clear multiple queues
|
|
115
|
+
|
|
116
|
+
**Data Sources**:
|
|
117
|
+
- `/api/v1/resources/queues` - Queue list
|
|
118
|
+
- `/api/v1/analytics/queues` - Queue statistics
|
|
119
|
+
|
|
120
|
+
#### 2.2 Queue Detail View
|
|
121
|
+
**Purpose**: Detailed view of a single queue
|
|
122
|
+
|
|
123
|
+
**Features**:
|
|
124
|
+
- **Queue Info Card**: Name, namespace, task, created date
|
|
125
|
+
- **Partition List**:
|
|
126
|
+
- Partition name
|
|
127
|
+
- Priority
|
|
128
|
+
- Message counts by status
|
|
129
|
+
- Configuration (lease time, retry limit)
|
|
130
|
+
- Actions (Configure, Clear)
|
|
131
|
+
- **Message Status Pie Chart**: Distribution of message states
|
|
132
|
+
- **Recent Messages Table**: Last 20 messages with status
|
|
133
|
+
- **Configuration Panel**: Edit queue/partition settings
|
|
134
|
+
|
|
135
|
+
**Data Sources**:
|
|
136
|
+
- `/api/v1/resources/queues/:queue` - Queue details
|
|
137
|
+
- `/api/v1/messages?queue=:queue` - Recent messages
|
|
138
|
+
- `/api/v1/configure` - Update configuration
|
|
139
|
+
|
|
140
|
+
#### 2.3 Partitions View
|
|
141
|
+
**Purpose**: Global partition management
|
|
142
|
+
|
|
143
|
+
**Features**:
|
|
144
|
+
- **Partition Table**:
|
|
145
|
+
- Queue/Partition path
|
|
146
|
+
- Priority
|
|
147
|
+
- Depth
|
|
148
|
+
- Processing count
|
|
149
|
+
- Configuration summary
|
|
150
|
+
- **Filter by Queue**: Dropdown to filter partitions
|
|
151
|
+
- **Sort by Priority/Depth**: Quick sorting options
|
|
152
|
+
|
|
153
|
+
**Data Sources**:
|
|
154
|
+
- `/api/v1/resources/partitions` - All partitions
|
|
155
|
+
|
|
156
|
+
### 3. Analytics View
|
|
157
|
+
**Purpose**: Detailed performance metrics and trends
|
|
158
|
+
|
|
159
|
+
**Features**:
|
|
160
|
+
- **Time Range Selector**: Last hour, 6 hours, 24 hours, 7 days
|
|
161
|
+
- **Multi-Metric Chart**:
|
|
162
|
+
- Incoming rate
|
|
163
|
+
- Completion rate
|
|
164
|
+
- Failure rate
|
|
165
|
+
- Processing lag
|
|
166
|
+
- **Queue Performance Table**:
|
|
167
|
+
- Queue name
|
|
168
|
+
- Throughput (msg/min)
|
|
169
|
+
- Average processing time
|
|
170
|
+
- Success rate
|
|
171
|
+
- Error rate
|
|
172
|
+
- **System Performance Cards**:
|
|
173
|
+
- Database pool usage
|
|
174
|
+
- Memory usage
|
|
175
|
+
- CPU usage
|
|
176
|
+
- Request rate
|
|
177
|
+
- **Top Queues by Volume**: Bar chart
|
|
178
|
+
- **Top Queues by Errors**: Bar chart
|
|
179
|
+
|
|
180
|
+
**Data Sources**:
|
|
181
|
+
- `/api/v1/analytics/throughput` - Throughput data
|
|
182
|
+
- `/api/v1/analytics/queue-stats` - Queue statistics
|
|
183
|
+
- `/metrics` - System metrics
|
|
184
|
+
|
|
185
|
+
### 4. Messages View
|
|
186
|
+
**Purpose**: Browse and manage individual messages
|
|
187
|
+
|
|
188
|
+
**Features**:
|
|
189
|
+
- **Message Search**:
|
|
190
|
+
- By queue
|
|
191
|
+
- By partition
|
|
192
|
+
- By status
|
|
193
|
+
- By date range
|
|
194
|
+
- **Message Table**:
|
|
195
|
+
- Transaction ID
|
|
196
|
+
- Queue/Partition
|
|
197
|
+
- Status with color coding
|
|
198
|
+
- Created/Completed times
|
|
199
|
+
- Retry count
|
|
200
|
+
- Actions (View, Retry, Delete, Move to DLQ)
|
|
201
|
+
- **Message Detail Modal**:
|
|
202
|
+
- Full payload JSON viewer
|
|
203
|
+
- Complete timeline
|
|
204
|
+
- Error details if failed
|
|
205
|
+
- Related messages
|
|
206
|
+
|
|
207
|
+
**Data Sources**:
|
|
208
|
+
- `/api/v1/messages` - Message list
|
|
209
|
+
- `/api/v1/messages/:id` - Message details
|
|
210
|
+
- `/api/v1/messages/:id/related` - Related messages
|
|
211
|
+
|
|
212
|
+
## UI/UX Design Principles
|
|
213
|
+
|
|
214
|
+
### Visual Design
|
|
215
|
+
1. **Color Scheme**:
|
|
216
|
+
- Primary: PrimeVue Aura theme (blue/indigo)
|
|
217
|
+
- Success: Green (#10b981)
|
|
218
|
+
- Warning: Amber (#f59e0b)
|
|
219
|
+
- Error: Red (#ef4444)
|
|
220
|
+
- Neutral: Gray scale
|
|
221
|
+
|
|
222
|
+
2. **Typography**:
|
|
223
|
+
- Headers: Inter or system font
|
|
224
|
+
- Body: System font stack
|
|
225
|
+
- Monospace: For IDs and code
|
|
226
|
+
|
|
227
|
+
3. **Layout**:
|
|
228
|
+
- Fixed header with navigation
|
|
229
|
+
- Collapsible sidebar for mobile
|
|
230
|
+
- Content area with consistent padding
|
|
231
|
+
- Card-based component layout
|
|
232
|
+
|
|
233
|
+
4. **Animations**:
|
|
234
|
+
- Smooth transitions for route changes
|
|
235
|
+
- Subtle hover effects
|
|
236
|
+
- Loading skeletons for data fetching
|
|
237
|
+
- Real-time data updates with fade effects
|
|
238
|
+
|
|
239
|
+
### Responsive Design
|
|
240
|
+
- **Desktop** (>1024px): Full sidebar, multi-column layouts
|
|
241
|
+
- **Tablet** (768-1024px): Collapsible sidebar, adjusted grids
|
|
242
|
+
- **Mobile** (<768px): Bottom navigation, single column, simplified charts
|
|
243
|
+
|
|
244
|
+
### Accessibility
|
|
245
|
+
- Proper ARIA labels
|
|
246
|
+
- Keyboard navigation support
|
|
247
|
+
- High contrast mode support
|
|
248
|
+
- Screen reader friendly
|
|
249
|
+
|
|
250
|
+
## Real-time Features
|
|
251
|
+
|
|
252
|
+
### WebSocket Integration
|
|
253
|
+
```javascript
|
|
254
|
+
// Connection management
|
|
255
|
+
- Auto-reconnect on disconnect
|
|
256
|
+
- Heartbeat/ping-pong
|
|
257
|
+
- Event subscription system
|
|
258
|
+
|
|
259
|
+
// Event handling
|
|
260
|
+
- Queue depth updates (every 5s)
|
|
261
|
+
- Message state changes
|
|
262
|
+
- System statistics (every 10s)
|
|
263
|
+
- Visual indicators for real-time data
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### Data Refresh Strategy
|
|
267
|
+
- Dashboard: Real-time via WebSocket
|
|
268
|
+
- Resource views: Refresh on focus + manual refresh
|
|
269
|
+
- Analytics: Auto-refresh every 30s
|
|
270
|
+
- Messages: Manual refresh only
|
|
271
|
+
|
|
272
|
+
## Performance Optimizations
|
|
273
|
+
|
|
274
|
+
1. **Code Splitting**:
|
|
275
|
+
- Lazy load routes
|
|
276
|
+
- Dynamic import for charts
|
|
277
|
+
|
|
278
|
+
2. **Data Management**:
|
|
279
|
+
- Pagination for large datasets
|
|
280
|
+
- Virtual scrolling for long lists
|
|
281
|
+
- Debounced search inputs
|
|
282
|
+
|
|
283
|
+
3. **Caching**:
|
|
284
|
+
- Cache static resources
|
|
285
|
+
- Short-term cache for analytics data
|
|
286
|
+
|
|
287
|
+
4. **Bundle Size**:
|
|
288
|
+
- Tree-shake PrimeVue components
|
|
289
|
+
- Minimize external dependencies
|
|
290
|
+
|
|
291
|
+
## Implementation Phases
|
|
292
|
+
|
|
293
|
+
### Phase 1: Foundation (Current Focus)
|
|
294
|
+
1. ✅ Project setup with Vite
|
|
295
|
+
2. ✅ PrimeVue integration
|
|
296
|
+
3. ✅ Basic routing structure
|
|
297
|
+
4. ✅ Layout components
|
|
298
|
+
5. ✅ API service layer
|
|
299
|
+
|
|
300
|
+
### Phase 2: Core Views
|
|
301
|
+
1. ✅ Dashboard with basic metrics
|
|
302
|
+
2. ✅ Queue list and management
|
|
303
|
+
3. ✅ Basic analytics view
|
|
304
|
+
4. ✅ WebSocket connection
|
|
305
|
+
|
|
306
|
+
### Phase 3: Enhanced Features
|
|
307
|
+
1. ⏳ Advanced charts and visualizations
|
|
308
|
+
2. ⏳ Message browser and management
|
|
309
|
+
3. ⏳ Partition configuration UI
|
|
310
|
+
4. ⏳ System health monitoring
|
|
311
|
+
|
|
312
|
+
### Phase 4: Polish
|
|
313
|
+
1. ⏳ Responsive design refinements
|
|
314
|
+
2. ⏳ Dark mode support
|
|
315
|
+
3. ⏳ Export functionality
|
|
316
|
+
4. ⏳ User preferences
|
|
317
|
+
|
|
318
|
+
## API Integration Patterns
|
|
319
|
+
|
|
320
|
+
### Error Handling
|
|
321
|
+
```javascript
|
|
322
|
+
// Consistent error handling
|
|
323
|
+
try {
|
|
324
|
+
const data = await api.get('/endpoint')
|
|
325
|
+
} catch (error) {
|
|
326
|
+
toast.add({
|
|
327
|
+
severity: 'error',
|
|
328
|
+
summary: 'Error',
|
|
329
|
+
detail: error.message
|
|
330
|
+
})
|
|
331
|
+
}
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
### Loading States
|
|
335
|
+
- Show skeleton loaders during fetch
|
|
336
|
+
- Disable buttons during operations
|
|
337
|
+
- Progress bars for long operations
|
|
338
|
+
|
|
339
|
+
### Data Formatting
|
|
340
|
+
- Human-readable timestamps
|
|
341
|
+
- Number formatting (1.2K, 3.4M)
|
|
342
|
+
- Status badges with colors
|
|
343
|
+
- Percentage calculations
|
|
344
|
+
|
|
345
|
+
## Development Guidelines
|
|
346
|
+
|
|
347
|
+
### Component Structure
|
|
348
|
+
- Use Composition API with `<script setup>`
|
|
349
|
+
- Props validation with type definitions
|
|
350
|
+
- Emit events for parent communication
|
|
351
|
+
- Scoped styles with CSS modules where needed
|
|
352
|
+
|
|
353
|
+
### State Management
|
|
354
|
+
- Local state with ref/reactive
|
|
355
|
+
- Provide/inject for cross-component state
|
|
356
|
+
- No global store needed initially
|
|
357
|
+
|
|
358
|
+
### Code Style
|
|
359
|
+
- ESLint for code quality
|
|
360
|
+
- Prettier for formatting
|
|
361
|
+
- Meaningful variable names
|
|
362
|
+
- Comments for complex logic
|
|
363
|
+
|
|
364
|
+
## Testing Approach
|
|
365
|
+
- Manual testing for UI/UX
|
|
366
|
+
- API mocking for development
|
|
367
|
+
- Browser compatibility testing
|
|
368
|
+
- Performance profiling with Lighthouse
|
|
369
|
+
|
|
370
|
+
## Deployment
|
|
371
|
+
- Build with Vite: `npm run build`
|
|
372
|
+
- Serve static files from `/dashboard` path
|
|
373
|
+
- Configure server to proxy API calls
|
|
374
|
+
- Enable gzip compression
|
|
375
|
+
|
|
376
|
+
## Future Enhancements
|
|
377
|
+
- User authentication and authorization
|
|
378
|
+
- Custom alerting and notifications
|
|
379
|
+
- Data export (CSV, JSON)
|
|
380
|
+
- Saved filters and views
|
|
381
|
+
- Dashboard customization
|
|
382
|
+
- Mobile app consideration
|