queen-mq 0.1.6 → 0.2.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.
@@ -401,8 +401,8 @@ export async function testComplexPriorityScenarios(client) {
401
401
  }
402
402
 
403
403
  // Calculate average priority of first vs last 3 messages
404
- const firstThree = received.slice(0, 3).map(m => m.payload.priority);
405
- const lastThree = received.slice(-3).map(m => m.payload.priority);
404
+ const firstThree = received.slice(0, 3).map(m => m.data.priority);
405
+ const lastThree = received.slice(-3).map(m => m.data.priority);
406
406
 
407
407
  const avgFirst = firstThree.reduce((a, b) => a + b, 0) / 3;
408
408
  const avgLast = lastThree.reduce((a, b) => a + b, 0) / 3;
@@ -47,8 +47,8 @@ export async function testBusConsumerGroups(client) {
47
47
  }
48
48
 
49
49
  // Verify both groups got the same message IDs
50
- const group1Ids = group1Messages.map(m => m.payload.id).sort();
51
- const group2Ids = group2Messages.map(m => m.payload.id).sort();
50
+ const group1Ids = group1Messages.map(m => m.data.id).sort();
51
+ const group2Ids = group2Messages.map(m => m.data.id).sort();
52
52
 
53
53
  if (JSON.stringify(group1Ids) !== JSON.stringify(group2Ids)) {
54
54
  throw new Error('Consumer groups did not receive the same messages');
@@ -119,8 +119,8 @@ export async function testMixedMode(client) {
119
119
  }
120
120
 
121
121
  // Workers should get different messages (competing)
122
- const worker1Ids = worker1Messages.map(m => m.payload.id);
123
- const worker2Ids = worker2Messages.map(m => m.payload.id);
122
+ const worker1Ids = worker1Messages.map(m => m.data.id);
123
+ const worker2Ids = worker2Messages.map(m => m.data.id);
124
124
  const intersection = worker1Ids.filter(id => worker2Ids.includes(id));
125
125
 
126
126
  if (intersection.length > 0) {
@@ -150,8 +150,8 @@ export async function testMixedMode(client) {
150
150
  }
151
151
 
152
152
  // Verify groups got all messages
153
- const analyticsIds = analyticsMessages.map(m => m.payload.id).sort();
154
- const auditIds = auditMessages.map(m => m.payload.id).sort();
153
+ const analyticsIds = analyticsMessages.map(m => m.data.id).sort();
154
+ const auditIds = auditMessages.map(m => m.data.id).sort();
155
155
 
156
156
  if (JSON.stringify(analyticsIds) !== JSON.stringify([1, 2, 3, 4, 5, 6])) {
157
157
  throw new Error('Analytics group did not receive all messages');
@@ -418,7 +418,7 @@ export async function testWindowBuffer(client) {
418
418
  const task = `test-task-${timestamp}`;
419
419
  const queue3 = 'test-window-buffer-filtered-' + timestamp;
420
420
 
421
- await client.queue(queue3, { windowBuffer: 5 }, ns, task);
421
+ await client.queue(queue3, { windowBuffer: 5 }, { namespace: ns, task: task });
422
422
  await client.push(`${queue3}/p1`, { test: 'case3' });
423
423
 
424
424
  let gotCase3Immediate = false;
@@ -487,10 +487,10 @@ export async function testManyConsumerGroups(client) {
487
487
  }
488
488
 
489
489
  // Verify all groups got the same messages
490
- const firstGroupIds = groupResults[0].map(m => m.payload.id).sort();
490
+ const firstGroupIds = groupResults[0].map(m => m.data.id).sort();
491
491
 
492
492
  for (let g = 1; g < numGroups; g++) {
493
- const groupIds = groupResults[g].map(m => m.payload.id).sort();
493
+ const groupIds = groupResults[g].map(m => m.data.id).sort();
494
494
  if (JSON.stringify(groupIds) !== JSON.stringify(firstGroupIds)) {
495
495
  throw new Error(`Group ${g} got different messages`);
496
496
  }
@@ -90,6 +90,21 @@ import {
90
90
  testMessageDeduplication
91
91
  } from './advanced-pattern-tests.js';
92
92
 
93
+ import {
94
+ testPipelineBasic,
95
+ testPipelineErrorHandling,
96
+ testPipelineAutoRenewal,
97
+ testPipelineParallel,
98
+ testPipelineConcurrencyRaceCondition,
99
+ testPipelineContinuous,
100
+ testTransactionAPI,
101
+ testPipelineAtomic,
102
+ testManualLeaseRenewal,
103
+ testLeaseValidation,
104
+ testComplexPipelineWorkflow,
105
+ runAdvancedClientTests
106
+ } from './advanced-client-tests.js';
107
+
93
108
  // Helper to run a test with error handling and delay
94
109
  async function runTest(testFn) {
95
110
  try {
@@ -234,11 +249,31 @@ async function runTests() {
234
249
  await runTest(() => testXSSPrevention(client));
235
250
  }
236
251
 
252
+ // ============================================
253
+ // ADVANCED CLIENT FEATURE TESTS
254
+ // ============================================
255
+ if (!testFilter || testFilter === 'advanced' || testFilter === 'client') {
256
+ console.log('\nšŸš€ ADVANCED CLIENT FEATURES');
257
+ console.log('-'.repeat(40));
258
+
259
+ await runTest(() => testPipelineBasic(client));
260
+ await runTest(() => testPipelineErrorHandling(client));
261
+ await runTest(() => testPipelineAutoRenewal(client));
262
+ await runTest(() => testPipelineParallel(client));
263
+ await runTest(() => testPipelineConcurrencyRaceCondition(client));
264
+ await runTest(() => testPipelineContinuous(client));
265
+ await runTest(() => testTransactionAPI(client));
266
+ await runTest(() => testPipelineAtomic(client));
267
+ await runTest(() => testManualLeaseRenewal(client));
268
+ await runTest(() => testLeaseValidation(client));
269
+ await runTest(() => testComplexPipelineWorkflow(client));
270
+ }
271
+
237
272
  // ============================================
238
273
  // ADVANCED SCENARIO TESTS
239
274
  // ============================================
240
275
  if (!testFilter || testFilter === 'advanced' || testFilter === 'pattern') {
241
- console.log('\nšŸŽÆ ADVANCED SCENARIOS');
276
+ console.log('\nšŸŽÆ ADVANCED PATTERNS');
242
277
  console.log('-'.repeat(40));
243
278
 
244
279
  await runTest(() => testMultiStagePipeline(client));