@zdavison/matador 4.0.1 → 4.0.3

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.
Files changed (38) hide show
  1. package/dist/core/fanout.d.ts +62 -0
  2. package/dist/core/fanout.d.ts.map +1 -1
  3. package/dist/core/fanout.js +217 -15
  4. package/dist/core/fanout.test.js +904 -6
  5. package/dist/core/matador.d.ts +33 -0
  6. package/dist/core/matador.d.ts.map +1 -1
  7. package/dist/core/matador.js +6 -1
  8. package/dist/core/matador.test.js +243 -7
  9. package/dist/errors/index.d.ts +1 -1
  10. package/dist/errors/index.d.ts.map +1 -1
  11. package/dist/errors/index.js +2 -2
  12. package/dist/errors/matador-errors.d.ts +10 -8
  13. package/dist/errors/matador-errors.d.ts.map +1 -1
  14. package/dist/errors/matador-errors.js +18 -14
  15. package/dist/index.cjs +345 -73
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.d.cts +1 -1
  18. package/dist/index.d.ts +1 -1
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +2 -2
  21. package/dist/index.js.map +1 -1
  22. package/dist/transport/local/local-transport.d.ts +6 -0
  23. package/dist/transport/local/local-transport.d.ts.map +1 -1
  24. package/dist/transport/local/local-transport.js +35 -18
  25. package/dist/transport/local/local-transport.test.js +40 -4
  26. package/dist/transport/multi/multi-transport.d.ts +6 -0
  27. package/dist/transport/multi/multi-transport.d.ts.map +1 -1
  28. package/dist/transport/multi/multi-transport.js +20 -0
  29. package/dist/transport/multi/multi-transport.test.js +82 -0
  30. package/dist/transport/rabbitmq/rabbitmq-transport-reconnection.test.js +45 -6
  31. package/dist/transport/rabbitmq/rabbitmq-transport.d.ts +6 -0
  32. package/dist/transport/rabbitmq/rabbitmq-transport.d.ts.map +1 -1
  33. package/dist/transport/rabbitmq/rabbitmq-transport.js +83 -40
  34. package/dist/transport/transport.d.ts +12 -0
  35. package/dist/transport/transport.d.ts.map +1 -1
  36. package/dist/types/event.d.ts +17 -0
  37. package/dist/types/event.d.ts.map +1 -1
  38. package/package.json +1 -1
@@ -29,6 +29,12 @@ export declare class LocalTransport implements Transport {
29
29
  */
30
30
  private scheduleDelayedMessage;
31
31
  private enqueue;
32
+ /**
33
+ * Stores a message and delivers it to any active subscribers, without
34
+ * requiring one to be present. Dead-letter queues are meant to hold
35
+ * messages for later manual inspection, so they don't need a live consumer.
36
+ */
37
+ private storeAndDeliver;
32
38
  private deliverToSubscribers;
33
39
  subscribe(queue: string, handler: MessageHandler, options?: SubscribeOptions): Promise<Subscription>;
34
40
  complete(receipt: MessageReceipt): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"local-transport.d.ts","sourceRoot":"","sources":["../../../src/transport/local/local-transport.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAiB,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,SAAS,EACV,MAAM,iBAAiB,CAAC;AAiCzB;;;GAGG;AACH,qBAAa,cAAe,YAAW,SAAS;IAC9C,QAAQ,CAAC,IAAI,WAAW;IACxB,QAAQ,CAAC,YAAY,wBAAqB;IAE1C,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsC;IAC7D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA2C;IACzE,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAwB;IAC1D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA4C;IAC1E,OAAO,CAAC,gBAAgB,CAAK;IAC7B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAEpB,M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b,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,cAAc,EACvB,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,YAAY,CAAC;IA0ClB,QAAQ,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAWhD,gBAAgB,CACpB,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC;IAQhB;;OAEG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAInC;;OAEG;IACH,YAAY,IAAI,SAAS,cAAc,EAAE;IAIzC;;OAEG;IACH,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,QAAQ,EAAE;IAMtD;;OAEG;IACH,KAAK,IAAI,IAAI;IAYb;;;OAGG;IACG,UAAU,CACd,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC;QAAE,QAAQ,EAAE,QAAQ,CAAC;QAAC,OAAO,EAAE,cAAc,CAAA;KAAE,GAAG,IAAI,CAAC;IAmBlE,OAAO,CAAC,gBAAgB;CAQzB"}
@@ -1,4 +1,4 @@
1
- import { TransportNotConnectedError } from '../../errors/index.js';
1
+ import { LocalTransportNoActiveSubscriberError, TransportNotConnectedError, } from '../../errors/index.js';
2
2
  import { consoleLogger } from '../../hooks/index.js';
3
3
  import { resolveQueueName } from '../../topology/types.js';
4
4
  /**
@@ -13,6 +13,11 @@ const localCapabilities = {
13
13
  ordering: 'queue',
14
14
  priorities: false,
15
15
  };
16
+ /**
17
+ * Maximum number of completed message receipts to retain.
18
+ * Oldest receipts are dropped once this limit is exceeded
19
+ */
20
+ const MAX_COMPLETED_MESSAGES = 1000;
16
21
  /**
17
22
  * Local in-memory transport for testing and fallback.
18
23
  * Messages are stored in memory and delivered synchronously.
@@ -61,7 +66,7 @@ export class LocalTransport {
61
66
  for (const queueDef of topology.queues) {
62
67
  const queueName = resolveQueueName(topology.namespace, queueDef, topology.naming, topology.prefix);
63
68
  if (!this.queues.has(queueName)) {
64
- this.queues.set(queueName, []);
69
+ this.queues.set(queueName, new Map());
65
70
  }
66
71
  }
67
72
  }
@@ -92,6 +97,18 @@ export class LocalTransport {
92
97
  this.delayedTimers.add(timer);
93
98
  }
94
99
  async enqueue(queue, envelope) {
100
+ const subs = this.subscriptions.get(queue);
101
+ if (!subs || subs.length === 0) {
102
+ throw new LocalTransportNoActiveSubscriberError(queue);
103
+ }
104
+ await this.storeAndDeliver(queue, envelope);
105
+ }
106
+ /**
107
+ * Stores a message and delivers it to any active subscribers, without
108
+ * requiring one to be present. Dead-letter queues are meant to hold
109
+ * messages for later manual inspection, so they don't need a live consumer.
110
+ */
111
+ async storeAndDeliver(queue, envelope) {
95
112
  const messages = this.getOrCreateQueue(queue);
96
113
  const messageId = `${++this.messageIdCounter}`;
97
114
  const queuedMessage = {
@@ -99,16 +116,11 @@ export class LocalTransport {
99
116
  id: messageId,
100
117
  completed: false,
101
118
  };
102
- messages.push(queuedMessage);
103
- // Deliver to any active subscriptions
119
+ messages.set(messageId, queuedMessage);
104
120
  await this.deliverToSubscribers(queue, queuedMessage);
105
121
  }
106
122
  async deliverToSubscribers(queue, message) {
107
- const subs = this.subscriptions.get(queue);
108
- if (!subs) {
109
- this.logger.warn(`[Matador][LocalTransport] 🟡 No subscriptions found for queue '${queue}', message will be lost.`);
110
- return;
111
- }
123
+ const subs = this.subscriptions.get(queue) ?? [];
112
124
  for (const sub of subs) {
113
125
  if (!sub.active || message.completed)
114
126
  continue;
@@ -142,7 +154,7 @@ export class LocalTransport {
142
154
  subs.push(subscription);
143
155
  this.subscriptions.set(queue, subs);
144
156
  // Deliver any pending messages
145
- const messages = this.queues.get(queue) ?? [];
157
+ const messages = this.queues.get(queue)?.values() ?? [];
146
158
  for (const message of messages) {
147
159
  if (message.completed)
148
160
  continue;
@@ -159,6 +171,10 @@ export class LocalTransport {
159
171
  this.subscriptions.delete(queue);
160
172
  }
161
173
  },
174
+ // No-op: LocalTransport is only ever fed from within the process
175
+ // So, when shutting down, it needs to continue and handle new messages until the end
176
+ // As, an ongoing message (before shutdown) could create new (local) messages
177
+ pauseForShutdown: async () => { },
162
178
  get isActive() {
163
179
  return subscription.active;
164
180
  },
@@ -168,10 +184,14 @@ export class LocalTransport {
168
184
  const message = receipt.handle;
169
185
  message.completed = true;
170
186
  this.completedMessages.push(receipt);
187
+ if (this.completedMessages.length > MAX_COMPLETED_MESSAGES) {
188
+ this.completedMessages.shift();
189
+ }
190
+ this.queues.get(receipt.sourceQueue)?.delete(message.id);
171
191
  }
172
192
  async sendToDeadLetter(receipt, dlqName, envelope, _reason) {
173
193
  const dlqQueueName = `${receipt.sourceQueue}.${dlqName}`;
174
- await this.enqueue(dlqQueueName, envelope);
194
+ await this.storeAndDeliver(dlqQueueName, envelope);
175
195
  await this.complete(receipt);
176
196
  }
177
197
  // Test helpers
@@ -179,10 +199,7 @@ export class LocalTransport {
179
199
  * Gets the current size of a queue.
180
200
  */
181
201
  getQueueSize(queue) {
182
- const messages = this.queues.get(queue);
183
- if (!messages)
184
- return 0;
185
- return messages.filter((m) => !m.completed).length;
202
+ return this.queues.get(queue)?.size ?? 0;
186
203
  }
187
204
  /**
188
205
  * Gets all completed message receipts.
@@ -197,7 +214,7 @@ export class LocalTransport {
197
214
  const messages = this.queues.get(queue);
198
215
  if (!messages)
199
216
  return [];
200
- return messages.filter((m) => !m.completed).map((m) => m.envelope);
217
+ return Array.from(messages.values()).map((m) => m.envelope);
201
218
  }
202
219
  /**
203
220
  * Clears all state (for test isolation).
@@ -220,7 +237,7 @@ export class LocalTransport {
220
237
  const messages = this.queues.get(queue);
221
238
  if (!messages)
222
239
  return null;
223
- const pending = messages.find((m) => !m.completed);
240
+ const pending = messages.values().next().value;
224
241
  if (!pending)
225
242
  return null;
226
243
  const receipt = {
@@ -236,7 +253,7 @@ export class LocalTransport {
236
253
  getOrCreateQueue(queue) {
237
254
  let messages = this.queues.get(queue);
238
255
  if (!messages) {
239
- messages = [];
256
+ messages = new Map();
240
257
  this.queues.set(queue, messages);
241
258
  }
242
259
  return messages;
@@ -1,4 +1,5 @@
1
1
  import { beforeEach, describe, expect, it } from 'bun:test';
2
+ import { LocalTransportNoActiveSubscriberError } from '../../errors/index.js';
2
3
  import { createEnvelope } from '../../types/index.js';
3
4
  import { LocalTransport } from './local-transport.js';
4
5
  describe('LocalTransport', () => {
@@ -31,12 +32,19 @@ describe('LocalTransport', () => {
31
32
  describe('send and receive', () => {
32
33
  beforeEach(async () => {
33
34
  await transport.connect();
35
+ // A no-op subscriber makes 'test-queue' deliverable; LocalTransport now
36
+ // rejects sends to queues with no active subscriber in this process.
37
+ await transport.subscribe('test-queue', async () => { });
34
38
  });
35
39
  it('should throw when sending while disconnected', async () => {
36
40
  await transport.disconnect();
37
41
  const envelope = createTestEnvelope();
38
42
  await expect(transport.send('test-queue', envelope)).rejects.toThrow('is not connected');
39
43
  });
44
+ it('should throw when sending to a queue with no active subscriber', async () => {
45
+ const envelope = createTestEnvelope();
46
+ await expect(transport.send('unsubscribed-queue', envelope)).rejects.toThrow(LocalTransportNoActiveSubscriberError);
47
+ });
40
48
  it('should send and receive a message', async () => {
41
49
  const envelope = createTestEnvelope();
42
50
  await transport.send('test-queue', envelope);
@@ -66,6 +74,24 @@ describe('LocalTransport', () => {
66
74
  const received = await transport.receiveOne('empty-queue');
67
75
  expect(received).toBeNull();
68
76
  });
77
+ it('should preserve FIFO order of pending messages', async () => {
78
+ const envelopes = [0, 1, 2].map((seq) => createEnvelope({
79
+ eventKey: 'test.event',
80
+ targetSubscriber: 'test-subscriber',
81
+ data: { seq },
82
+ importance: 'should-investigate',
83
+ }));
84
+ for (const envelope of envelopes) {
85
+ await transport.send('test-queue', envelope);
86
+ }
87
+ expect(transport.getPendingMessages('test-queue').map((e) => e.data)).toEqual([{ seq: 0 }, { seq: 1 }, { seq: 2 }]);
88
+ for (const envelope of envelopes) {
89
+ const received = await transport.receiveOne('test-queue');
90
+ expect(received?.envelope.id).toBe(envelope.id);
91
+ if (received)
92
+ await transport.complete(received.receipt);
93
+ }
94
+ });
69
95
  });
70
96
  describe('subscriptions', () => {
71
97
  beforeEach(async () => {
@@ -85,14 +111,21 @@ describe('LocalTransport', () => {
85
111
  expect(receivedMessages).toHaveLength(1);
86
112
  expect(receivedMessages[0].id).toBe(envelope.id);
87
113
  });
88
- it('should deliver pending messages when subscribing', async () => {
114
+ it('should redeliver pending (uncompleted) messages to a newly attached subscriber', async () => {
115
+ const firstSubscriberMessages = [];
116
+ const firstSubscription = await transport.subscribe('test-queue', async (envelope) => {
117
+ firstSubscriberMessages.push(envelope);
118
+ });
89
119
  const envelope = createTestEnvelope();
90
120
  await transport.send('test-queue', envelope);
91
- const receivedMessages = [];
121
+ expect(firstSubscriberMessages).toHaveLength(1);
122
+ // First subscriber never completed the message before going away.
123
+ await firstSubscription.unsubscribe();
124
+ const secondSubscriberMessages = [];
92
125
  await transport.subscribe('test-queue', async (env) => {
93
- receivedMessages.push(env);
126
+ secondSubscriberMessages.push(env);
94
127
  });
95
- expect(receivedMessages).toHaveLength(1);
128
+ expect(secondSubscriberMessages).toHaveLength(1);
96
129
  });
97
130
  it('should stop delivering after unsubscribe', async () => {
98
131
  const receivedMessages = [];
@@ -108,6 +141,7 @@ describe('LocalTransport', () => {
108
141
  describe('dead letter queue', () => {
109
142
  beforeEach(async () => {
110
143
  await transport.connect();
144
+ await transport.subscribe('test-queue', async () => { });
111
145
  });
112
146
  it('should send messages to dead letter queue', async () => {
113
147
  const envelope = createTestEnvelope();
@@ -145,6 +179,7 @@ describe('LocalTransport', () => {
145
179
  describe('clear', () => {
146
180
  it('should reset all state', async () => {
147
181
  await transport.connect();
182
+ await transport.subscribe('test-queue', async () => { });
148
183
  await transport.send('test-queue', createTestEnvelope());
149
184
  const received = await transport.receiveOne('test-queue');
150
185
  if (!received)
@@ -158,6 +193,7 @@ describe('LocalTransport', () => {
158
193
  describe('delayed messages', () => {
159
194
  beforeEach(async () => {
160
195
  await transport.connect();
196
+ await transport.subscribe('test-queue', async () => { });
161
197
  });
162
198
  it('should return immediately and delay message delivery', async () => {
163
199
  const envelope = createTestEnvelope();
@@ -77,6 +77,12 @@ export declare class MultiTransport implements Transport {
77
77
  connect(): Promise<void>;
78
78
  disconnect(): Promise<void>;
79
79
  isConnected(): boolean;
80
+ /**
81
+ * Registers a callback to fire each time the transport successfully (re)connects
82
+ * @param callback - The callback to fire when the transport successfully (re)connects
83
+ * @returns A function to unsubscribe from the callback
84
+ */
85
+ onConnected(callback: () => void): () => void;
80
86
  applyTopology(topology: Topology): Promise<void>;
81
87
  send(queue: string, envelope: Envelope, options?: SendOptions): Promise<Transport['name']>;
82
88
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"multi-transport.d.ts","sourceRoot":"","sources":["../../../src/transport/multi/multi-transport.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,SAAS,EACV,MAAM,iBAAiB,CAAC;AAgBzB;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAC;IAE1C;;;;;;OAMG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MACzB,MAAM,GACN,SAAS,GACT,OAAO,CAAC,MAAM,GA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AAE,CAAC;IAE1C,2DAA2D;IAC3D,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAElC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAsB;IAC5C,OAAO,CAAC,SAAS,CAAS;gBAEd,MAAM,EAAE,oBAAoB,EAAE,KAAK,GAAE,mBAAwB;IAcnE,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAMxB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAMjC,WAAW,IAAI,OAAO;IAKtB;;;;OAIG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAcvC,aAAa,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAKhD,IAAI,CACR,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,QAAQ,EAClB,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IA0C7B;;OAEG;YACW,eAAe;IAwB7B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IASnB,SAAS,CACb,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,cAAc,EACvB,OAAO,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,YAAY,CAAC;IA+BlB,QAAQ,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAKhD,gBAAgB,CACpB,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC;CAOjB"}
@@ -75,6 +75,23 @@ export class MultiTransport {
75
75
  // Consider connected if primary is connected
76
76
  return this.connected && this.primary.isConnected();
77
77
  }
78
+ /**
79
+ * Registers a callback to fire each time the transport successfully (re)connects
80
+ * @param callback - The callback to fire when the transport successfully (re)connects
81
+ * @returns A function to unsubscribe from the callback
82
+ */
83
+ onConnected(callback) {
84
+ // This adds the callback on all transports that support it, and returns functions to unsubscribe from all transports
85
+ const unsubFunctions = this.transports
86
+ .map((t) => t.onConnected?.(callback))
87
+ .filter(Boolean);
88
+ // Return a function to unsubscribe from all transports
89
+ return () => {
90
+ for (const unsub of unsubFunctions) {
91
+ unsub();
92
+ }
93
+ };
94
+ }
78
95
  async applyTopology(topology) {
79
96
  // Apply topology to all transports so they're all ready
80
97
  await Promise.all(this.transports.map((t) => t.applyTopology(topology)));
@@ -167,6 +184,9 @@ export class MultiTransport {
167
184
  unsubscribe: async () => {
168
185
  await Promise.all(subscriptions.map((s) => s.unsubscribe()));
169
186
  },
187
+ pauseForShutdown: async () => {
188
+ await Promise.all(subscriptions.map((s) => (s.pauseForShutdown ?? s.unsubscribe)()));
189
+ },
170
190
  get isActive() {
171
191
  return subscriptions.some((s) => s.isActive);
172
192
  },
@@ -83,6 +83,7 @@ describe('MultiTransport', () => {
83
83
  describe('send - primary success', () => {
84
84
  beforeEach(async () => {
85
85
  await transport.connect();
86
+ await transport.subscribe('test-queue', async () => { });
86
87
  });
87
88
  it('should send to primary transport when it succeeds', async () => {
88
89
  const envelope = createTestEnvelope();
@@ -102,6 +103,7 @@ describe('MultiTransport', () => {
102
103
  describe('send - fallback', () => {
103
104
  beforeEach(async () => {
104
105
  await transport.connect();
106
+ await transport.subscribe('test-queue', async () => { });
105
107
  });
106
108
  it('should fallback when primary fails', async () => {
107
109
  // Make primary fail
@@ -140,6 +142,7 @@ describe('MultiTransport', () => {
140
142
  transports: [primary, secondary, third],
141
143
  });
142
144
  await multiTransport.connect();
145
+ await third.subscribe('test-queue', async () => { });
143
146
  // Make primary and secondary fail
144
147
  await primary.disconnect();
145
148
  await secondary.disconnect();
@@ -200,10 +203,88 @@ describe('MultiTransport', () => {
200
203
  expect(receivedMessages).toHaveLength(1);
201
204
  expect(receivedMessages[0].id).toBe(envelope.id);
202
205
  });
206
+ it('should leave sub-transports subscribed when pauseForShutdown is a no-op', async () => {
207
+ const receivedMessages = [];
208
+ const subscription = await transport.subscribe('test-queue', async (envelope) => {
209
+ receivedMessages.push(envelope);
210
+ });
211
+ // Both primary and secondary here are LocalTransport, whose
212
+ // pauseForShutdown is a no-op — pausing the aggregate must leave both
213
+ // underlying subscriptions untouched.
214
+ await subscription.pauseForShutdown?.();
215
+ await primary.send('test-queue', createTestEnvelope());
216
+ expect(receivedMessages).toHaveLength(1);
217
+ });
218
+ it('should call pauseForShutdown on sub-transports that implement it', async () => {
219
+ const externalPauseForShutdown = mock(async () => { });
220
+ const externalMock = {
221
+ name: 'rabbitmq',
222
+ capabilities: {
223
+ deliveryModes: ['at-least-once'],
224
+ delayedMessages: false,
225
+ deadLetterRouting: 'native',
226
+ attemptTracking: true,
227
+ concurrencyModel: 'prefetch',
228
+ ordering: 'none',
229
+ priorities: false,
230
+ },
231
+ isConnected: () => true,
232
+ connect: mock(async () => { }),
233
+ disconnect: mock(async () => { }),
234
+ send: mock(async () => 'rabbitmq'),
235
+ subscribe: mock(async () => ({
236
+ unsubscribe: mock(async () => { }),
237
+ pauseForShutdown: externalPauseForShutdown,
238
+ isActive: true,
239
+ })),
240
+ applyTopology: mock(async () => { }),
241
+ complete: mock(async () => { }),
242
+ };
243
+ const multiWithExternal = new MultiTransport({
244
+ transports: [externalMock, primary],
245
+ });
246
+ await multiWithExternal.connect();
247
+ const subscription = await multiWithExternal.subscribe('test-queue', async () => { });
248
+ await subscription.pauseForShutdown?.();
249
+ expect(externalPauseForShutdown).toHaveBeenCalledTimes(1);
250
+ });
251
+ it('should fall back to unsubscribe for sub-transports without pauseForShutdown', async () => {
252
+ const externalUnsubscribe = mock(async () => { });
253
+ const externalMock = {
254
+ name: 'rabbitmq',
255
+ capabilities: {
256
+ deliveryModes: ['at-least-once'],
257
+ delayedMessages: false,
258
+ deadLetterRouting: 'native',
259
+ attemptTracking: true,
260
+ concurrencyModel: 'prefetch',
261
+ ordering: 'none',
262
+ priorities: false,
263
+ },
264
+ isConnected: () => true,
265
+ connect: mock(async () => { }),
266
+ disconnect: mock(async () => { }),
267
+ send: mock(async () => 'rabbitmq'),
268
+ subscribe: mock(async () => ({
269
+ unsubscribe: externalUnsubscribe,
270
+ isActive: true,
271
+ })),
272
+ applyTopology: mock(async () => { }),
273
+ complete: mock(async () => { }),
274
+ };
275
+ const multiWithExternal = new MultiTransport({
276
+ transports: [externalMock, primary],
277
+ });
278
+ await multiWithExternal.connect();
279
+ const subscription = await multiWithExternal.subscribe('test-queue', async () => { });
280
+ await subscription.pauseForShutdown?.();
281
+ expect(externalUnsubscribe).toHaveBeenCalledTimes(1);
282
+ });
203
283
  });
204
284
  describe('complete', () => {
205
285
  beforeEach(async () => {
206
286
  await transport.connect();
287
+ await primary.subscribe('test-queue', async () => { });
207
288
  });
208
289
  it('should complete using primary transport', async () => {
209
290
  await primary.send('test-queue', createTestEnvelope());
@@ -217,6 +298,7 @@ describe('MultiTransport', () => {
217
298
  describe('sendToDeadLetter', () => {
218
299
  beforeEach(async () => {
219
300
  await transport.connect();
301
+ await primary.subscribe('test-queue', async () => { });
220
302
  });
221
303
  it('should send to dead letter using primary transport', async () => {
222
304
  const envelope = createTestEnvelope();
@@ -12,9 +12,15 @@ mock.module('amqplib', () => {
12
12
  const closeHandlers = [];
13
13
  // Total number of times channel.consume() has been called across all connections.
14
14
  let consumeCallCount = 0;
15
+ // close() call count per connection, indexed by creation order.
16
+ const connectionCloseCounts = [];
17
+ // Set to a connection index to make that connection's createConfirmChannel throw.
18
+ let failConfirmChannelOnConnection = -1;
15
19
  function resetMockState() {
16
20
  closeHandlers.length = 0;
17
21
  consumeCallCount = 0;
22
+ connectionCloseCounts.length = 0;
23
+ failConfirmChannelOnConnection = -1;
18
24
  }
19
25
  function makeMockChannel() {
20
26
  return {
@@ -37,6 +43,8 @@ function makeMockChannel() {
37
43
  };
38
44
  }
39
45
  function mockConnect() {
46
+ const index = connectionCloseCounts.length;
47
+ connectionCloseCounts.push(0);
40
48
  const channel = makeMockChannel();
41
49
  const connectionCloseListeners = [];
42
50
  const connection = {
@@ -47,8 +55,17 @@ function mockConnect() {
47
55
  }
48
56
  },
49
57
  createChannel: async () => channel,
50
- createConfirmChannel: async () => channel,
51
- close: async () => { },
58
+ createConfirmChannel: async () => {
59
+ if (failConfirmChannelOnConnection === index) {
60
+ throw new Error('simulated channel creation failure');
61
+ }
62
+ return channel;
63
+ },
64
+ close: async () => {
65
+ if (connectionCloseCounts[index] !== undefined) {
66
+ connectionCloseCounts[index]++;
67
+ }
68
+ },
52
69
  };
53
70
  return Promise.resolve(connection);
54
71
  }
@@ -89,7 +106,6 @@ describe('RabbitMQTransport – consumer recreation on reconnect', () => {
89
106
  triggerClose();
90
107
  // Give the ConnectionManager time to reconnect (initialReconnectDelay = 10 ms).
91
108
  await new Promise((resolve) => setTimeout(resolve, 100));
92
- // After reconnect, doConnect() runs again and re-applies topology and recreates consumers.
93
109
  expect(consumeCallCount).toBe(2);
94
110
  });
95
111
  it('delivers messages to the handler after reconnect', async () => {
@@ -97,14 +113,37 @@ describe('RabbitMQTransport – consumer recreation on reconnect', () => {
97
113
  await transport.subscribe('test.events', async (envelope) => {
98
114
  received.push(envelope);
99
115
  });
100
- // Trigger reconnect
101
116
  const triggerClose = closeHandlers[0];
102
117
  if (!triggerClose)
103
118
  throw new Error('no close handler captured from mock connection');
104
119
  triggerClose();
105
120
  await new Promise((resolve) => setTimeout(resolve, 100));
106
- // After reconnect the consumer should be active. Simulate message delivery
107
- // by invoking the consume callback captured in the mock.
121
+ expect(consumeCallCount).toBe(2);
122
+ });
123
+ it('closes the previous (dead) connection before opening a new one', async () => {
124
+ await transport.subscribe('test.events', async () => { });
125
+ // Trigger a new connect (private method)
126
+ // biome-ignore lint/complexity/useLiteralKeys: private method
127
+ await transport['doConnect']();
128
+ // doConnect() must call close() on the stale first connection before
129
+ // creating a new one, so broker resources are not leaked.
130
+ expect(connectionCloseCounts[0]).toBe(1);
131
+ });
132
+ it('closes the new connection when post-connect setup fails during reconnect', async () => {
133
+ await transport.subscribe('test.events', async () => { });
134
+ // Make the second connection's confirm channel creation fail.
135
+ // ConnectionManager will retry; the third connection succeeds.
136
+ failConfirmChannelOnConnection = 1;
137
+ const triggerClose = closeHandlers[0];
138
+ if (!triggerClose)
139
+ throw new Error('no close handler captured from mock connection');
140
+ triggerClose();
141
+ // Wait for the failed attempt (~10 ms) + successful retry (~10 ms) + margin.
142
+ await new Promise((resolve) => setTimeout(resolve, 150));
143
+ // The failed connection (index 1) must be closed by the catch block so it
144
+ // does not leak as an open broker connection while the retry loop continues.
145
+ expect(connectionCloseCounts[1]).toBe(1);
146
+ // The successful retry (connection index 2) recreates the consumer.
108
147
  expect(consumeCallCount).toBe(2);
109
148
  });
110
149
  });
@@ -61,6 +61,12 @@ export declare class RabbitMQTransport implements Transport {
61
61
  connect(): Promise<void>;
62
62
  disconnect(): Promise<void>;
63
63
  isConnected(): boolean;
64
+ /**
65
+ * Registers a callback to fire each time the transport (here RabbitMQ) successfully (re)connects
66
+ * @param callback - The callback to fire when the transport (here RabbitMQ) successfully (re)connects
67
+ * @returns A function to unsubscribe from the callback
68
+ */
69
+ onConnected(callback: () => void): () => void;
64
70
  applyTopology(topology: Topology): Promise<void>;
65
71
  send(queue: string, envelope: Envelope, options?: SendOptions): Promise<Transport['name']>;
66
72
  subscribe(queue: string, handler: MessageHandler, options?: SubscribeOptions): Promise<Subscription>;
@@ -1 +1 @@
1
- {"version":3,"file":"rabbitmq-transport.d.ts","sourceRoot":"","sources":["../../../src/transport/rabbitmq/rabbitmq-transport.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,KAAK,MAAM,EAAiB,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EAAmB,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAOzE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,0BAA0B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