amqpx 0.0.0 → 1.0.1

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 (245) hide show
  1. package/LICENSE +8 -0
  2. package/README.md +63 -0
  3. package/dist/cjs/channel/channel-implementation.d.ts +30 -0
  4. package/dist/cjs/channel/channel-implementation.js +212 -0
  5. package/dist/cjs/channel/channel.d.ts +149 -0
  6. package/dist/cjs/channel/channel.js +2 -0
  7. package/dist/cjs/channel/index.d.ts +2 -0
  8. package/dist/cjs/channel/index.js +5 -0
  9. package/dist/cjs/channel/types.d.ts +12 -0
  10. package/dist/cjs/channel/types.js +2 -0
  11. package/dist/cjs/connection/connection-implementation.d.ts +35 -0
  12. package/dist/cjs/connection/connection-implementation.js +195 -0
  13. package/dist/cjs/connection/connection.d.ts +143 -0
  14. package/dist/cjs/connection/connection.js +11 -0
  15. package/dist/cjs/connection/index.d.ts +2 -0
  16. package/dist/cjs/connection/index.js +8 -0
  17. package/dist/cjs/consumer/base-consumer.d.ts +33 -0
  18. package/dist/cjs/consumer/base-consumer.js +85 -0
  19. package/dist/cjs/consumer/batch-consumer-implementation.d.ts +25 -0
  20. package/dist/cjs/consumer/batch-consumer-implementation.js +313 -0
  21. package/dist/cjs/consumer/batch-consumer.d.ts +39 -0
  22. package/dist/cjs/consumer/batch-consumer.js +2 -0
  23. package/dist/cjs/consumer/consumer-implementation.d.ts +12 -0
  24. package/dist/cjs/consumer/consumer-implementation.js +105 -0
  25. package/dist/cjs/consumer/consumer.d.ts +40 -0
  26. package/dist/cjs/consumer/consumer.js +4 -0
  27. package/dist/cjs/consumer/index.d.ts +5 -0
  28. package/dist/cjs/consumer/index.js +10 -0
  29. package/dist/cjs/consumer/types.d.ts +194 -0
  30. package/dist/cjs/consumer/types.js +34 -0
  31. package/dist/cjs/errors.d.ts +22 -0
  32. package/dist/cjs/errors.js +13 -0
  33. package/dist/cjs/exchange/default-exchange.d.ts +10 -0
  34. package/dist/cjs/exchange/default-exchange.js +14 -0
  35. package/dist/cjs/exchange/exchange-implementation.d.ts +24 -0
  36. package/dist/cjs/exchange/exchange-implementation.js +159 -0
  37. package/dist/cjs/exchange/exchange.d.ts +67 -0
  38. package/dist/cjs/exchange/exchange.js +2 -0
  39. package/dist/cjs/exchange/index.d.ts +3 -0
  40. package/dist/cjs/exchange/index.js +5 -0
  41. package/dist/cjs/exchange/types.d.ts +58 -0
  42. package/dist/cjs/exchange/types.js +8 -0
  43. package/dist/cjs/extensions/jest/index.d.ts +7 -0
  44. package/dist/cjs/extensions/jest/index.js +23 -0
  45. package/dist/cjs/extensions/jest/test-batch-consumer.d.ts +48 -0
  46. package/dist/cjs/extensions/jest/test-batch-consumer.js +56 -0
  47. package/dist/cjs/extensions/jest/test-channel.d.ts +71 -0
  48. package/dist/cjs/extensions/jest/test-channel.js +75 -0
  49. package/dist/cjs/extensions/jest/test-connection.d.ts +38 -0
  50. package/dist/cjs/extensions/jest/test-connection.js +29 -0
  51. package/dist/cjs/extensions/jest/test-consumer.d.ts +49 -0
  52. package/dist/cjs/extensions/jest/test-consumer.js +54 -0
  53. package/dist/cjs/extensions/jest/test-exchange.d.ts +26 -0
  54. package/dist/cjs/extensions/jest/test-exchange.js +16 -0
  55. package/dist/cjs/extensions/jest/test-producer.d.ts +33 -0
  56. package/dist/cjs/extensions/jest/test-producer.js +17 -0
  57. package/dist/cjs/extensions/jest/test-queue.d.ts +25 -0
  58. package/dist/cjs/extensions/jest/test-queue.js +17 -0
  59. package/dist/cjs/extensions/vitest/index.d.ts +7 -0
  60. package/dist/cjs/extensions/vitest/index.js +23 -0
  61. package/dist/cjs/extensions/vitest/test-batch-consumer.d.ts +48 -0
  62. package/dist/cjs/extensions/vitest/test-batch-consumer.js +56 -0
  63. package/dist/cjs/extensions/vitest/test-channel.d.ts +71 -0
  64. package/dist/cjs/extensions/vitest/test-channel.js +77 -0
  65. package/dist/cjs/extensions/vitest/test-connection.d.ts +38 -0
  66. package/dist/cjs/extensions/vitest/test-connection.js +29 -0
  67. package/dist/cjs/extensions/vitest/test-consumer.d.ts +49 -0
  68. package/dist/cjs/extensions/vitest/test-consumer.js +54 -0
  69. package/dist/cjs/extensions/vitest/test-exchange.d.ts +26 -0
  70. package/dist/cjs/extensions/vitest/test-exchange.js +16 -0
  71. package/dist/cjs/extensions/vitest/test-producer.d.ts +34 -0
  72. package/dist/cjs/extensions/vitest/test-producer.js +18 -0
  73. package/dist/cjs/extensions/vitest/test-queue.d.ts +25 -0
  74. package/dist/cjs/extensions/vitest/test-queue.js +17 -0
  75. package/dist/cjs/extensions/zod/index.d.ts +2 -0
  76. package/dist/cjs/extensions/zod/index.js +18 -0
  77. package/dist/cjs/extensions/zod/zod-validated-batch-consumer.d.ts +57 -0
  78. package/dist/cjs/extensions/zod/zod-validated-batch-consumer.js +46 -0
  79. package/dist/cjs/extensions/zod/zod-validated-consumer.d.ts +55 -0
  80. package/dist/cjs/extensions/zod/zod-validated-consumer.js +42 -0
  81. package/dist/cjs/graceful-shutdown/index.d.ts +1 -0
  82. package/dist/cjs/graceful-shutdown/index.js +17 -0
  83. package/dist/cjs/graceful-shutdown/rabbit-closer.d.ts +29 -0
  84. package/dist/cjs/graceful-shutdown/rabbit-closer.js +42 -0
  85. package/dist/cjs/index.d.ts +11 -0
  86. package/dist/cjs/index.js +51 -0
  87. package/dist/cjs/package.json +1 -0
  88. package/dist/cjs/predefined.d.ts +62 -0
  89. package/dist/cjs/predefined.js +27 -0
  90. package/dist/cjs/producer/index.d.ts +3 -0
  91. package/dist/cjs/producer/index.js +5 -0
  92. package/dist/cjs/producer/producer-implementation.d.ts +18 -0
  93. package/dist/cjs/producer/producer-implementation.js +109 -0
  94. package/dist/cjs/producer/producer.d.ts +44 -0
  95. package/dist/cjs/producer/producer.js +2 -0
  96. package/dist/cjs/producer/types.d.ts +70 -0
  97. package/dist/cjs/producer/types.js +13 -0
  98. package/dist/cjs/queue/index.d.ts +3 -0
  99. package/dist/cjs/queue/index.js +5 -0
  100. package/dist/cjs/queue/queue-implementation.d.ts +21 -0
  101. package/dist/cjs/queue/queue-implementation.js +91 -0
  102. package/dist/cjs/queue/queue.d.ts +55 -0
  103. package/dist/cjs/queue/queue.js +2 -0
  104. package/dist/cjs/queue/types.d.ts +25 -0
  105. package/dist/cjs/queue/types.js +2 -0
  106. package/dist/cjs/retry/default-retry-strategy.d.ts +9 -0
  107. package/dist/cjs/retry/default-retry-strategy.js +8 -0
  108. package/dist/cjs/retry/index.d.ts +4 -0
  109. package/dist/cjs/retry/index.js +45 -0
  110. package/dist/cjs/retry/retry-implementation.d.ts +18 -0
  111. package/dist/cjs/retry/retry-implementation.js +44 -0
  112. package/dist/cjs/retry/retry-strategy.d.ts +28 -0
  113. package/dist/cjs/retry/retry-strategy.js +10 -0
  114. package/dist/cjs/retry/time-strategies.d.ts +45 -0
  115. package/dist/cjs/retry/time-strategies.js +32 -0
  116. package/dist/cjs/types.d.ts +30 -0
  117. package/dist/cjs/types.js +9 -0
  118. package/dist/cjs/utils.d.ts +11 -0
  119. package/dist/cjs/utils.js +83 -0
  120. package/dist/esm/channel/channel-implementation.d.ts +30 -0
  121. package/dist/esm/channel/channel-implementation.js +208 -0
  122. package/dist/esm/channel/channel.d.ts +149 -0
  123. package/dist/esm/channel/channel.js +1 -0
  124. package/dist/esm/channel/index.d.ts +2 -0
  125. package/dist/esm/channel/index.js +1 -0
  126. package/dist/esm/channel/types.d.ts +12 -0
  127. package/dist/esm/channel/types.js +1 -0
  128. package/dist/esm/connection/connection-implementation.d.ts +35 -0
  129. package/dist/esm/connection/connection-implementation.js +157 -0
  130. package/dist/esm/connection/connection.d.ts +143 -0
  131. package/dist/esm/connection/connection.js +8 -0
  132. package/dist/esm/connection/index.d.ts +2 -0
  133. package/dist/esm/connection/index.js +2 -0
  134. package/dist/esm/consumer/base-consumer.d.ts +33 -0
  135. package/dist/esm/consumer/base-consumer.js +81 -0
  136. package/dist/esm/consumer/batch-consumer-implementation.d.ts +25 -0
  137. package/dist/esm/consumer/batch-consumer-implementation.js +309 -0
  138. package/dist/esm/consumer/batch-consumer.d.ts +39 -0
  139. package/dist/esm/consumer/batch-consumer.js +1 -0
  140. package/dist/esm/consumer/consumer-implementation.d.ts +12 -0
  141. package/dist/esm/consumer/consumer-implementation.js +101 -0
  142. package/dist/esm/consumer/consumer.d.ts +40 -0
  143. package/dist/esm/consumer/consumer.js +1 -0
  144. package/dist/esm/consumer/index.d.ts +5 -0
  145. package/dist/esm/consumer/index.js +3 -0
  146. package/dist/esm/consumer/types.d.ts +194 -0
  147. package/dist/esm/consumer/types.js +31 -0
  148. package/dist/esm/errors.d.ts +22 -0
  149. package/dist/esm/errors.js +8 -0
  150. package/dist/esm/exchange/default-exchange.d.ts +10 -0
  151. package/dist/esm/exchange/default-exchange.js +10 -0
  152. package/dist/esm/exchange/exchange-implementation.d.ts +24 -0
  153. package/dist/esm/exchange/exchange-implementation.js +152 -0
  154. package/dist/esm/exchange/exchange.d.ts +67 -0
  155. package/dist/esm/exchange/exchange.js +1 -0
  156. package/dist/esm/exchange/index.d.ts +3 -0
  157. package/dist/esm/exchange/index.js +1 -0
  158. package/dist/esm/exchange/types.d.ts +58 -0
  159. package/dist/esm/exchange/types.js +5 -0
  160. package/dist/esm/extensions/jest/index.d.ts +7 -0
  161. package/dist/esm/extensions/jest/index.js +7 -0
  162. package/dist/esm/extensions/jest/test-batch-consumer.d.ts +48 -0
  163. package/dist/esm/extensions/jest/test-batch-consumer.js +52 -0
  164. package/dist/esm/extensions/jest/test-channel.d.ts +71 -0
  165. package/dist/esm/extensions/jest/test-channel.js +71 -0
  166. package/dist/esm/extensions/jest/test-connection.d.ts +38 -0
  167. package/dist/esm/extensions/jest/test-connection.js +25 -0
  168. package/dist/esm/extensions/jest/test-consumer.d.ts +49 -0
  169. package/dist/esm/extensions/jest/test-consumer.js +50 -0
  170. package/dist/esm/extensions/jest/test-exchange.d.ts +26 -0
  171. package/dist/esm/extensions/jest/test-exchange.js +12 -0
  172. package/dist/esm/extensions/jest/test-producer.d.ts +33 -0
  173. package/dist/esm/extensions/jest/test-producer.js +13 -0
  174. package/dist/esm/extensions/jest/test-queue.d.ts +25 -0
  175. package/dist/esm/extensions/jest/test-queue.js +13 -0
  176. package/dist/esm/extensions/vitest/index.d.ts +7 -0
  177. package/dist/esm/extensions/vitest/index.js +7 -0
  178. package/dist/esm/extensions/vitest/test-batch-consumer.d.ts +48 -0
  179. package/dist/esm/extensions/vitest/test-batch-consumer.js +52 -0
  180. package/dist/esm/extensions/vitest/test-channel.d.ts +71 -0
  181. package/dist/esm/extensions/vitest/test-channel.js +73 -0
  182. package/dist/esm/extensions/vitest/test-connection.d.ts +38 -0
  183. package/dist/esm/extensions/vitest/test-connection.js +25 -0
  184. package/dist/esm/extensions/vitest/test-consumer.d.ts +49 -0
  185. package/dist/esm/extensions/vitest/test-consumer.js +50 -0
  186. package/dist/esm/extensions/vitest/test-exchange.d.ts +26 -0
  187. package/dist/esm/extensions/vitest/test-exchange.js +12 -0
  188. package/dist/esm/extensions/vitest/test-producer.d.ts +34 -0
  189. package/dist/esm/extensions/vitest/test-producer.js +14 -0
  190. package/dist/esm/extensions/vitest/test-queue.d.ts +25 -0
  191. package/dist/esm/extensions/vitest/test-queue.js +13 -0
  192. package/dist/esm/extensions/zod/index.d.ts +2 -0
  193. package/dist/esm/extensions/zod/index.js +2 -0
  194. package/dist/esm/extensions/zod/zod-validated-batch-consumer.d.ts +57 -0
  195. package/dist/esm/extensions/zod/zod-validated-batch-consumer.js +42 -0
  196. package/dist/esm/extensions/zod/zod-validated-consumer.d.ts +55 -0
  197. package/dist/esm/extensions/zod/zod-validated-consumer.js +38 -0
  198. package/dist/esm/graceful-shutdown/index.d.ts +1 -0
  199. package/dist/esm/graceful-shutdown/index.js +1 -0
  200. package/dist/esm/graceful-shutdown/rabbit-closer.d.ts +29 -0
  201. package/dist/esm/graceful-shutdown/rabbit-closer.js +38 -0
  202. package/dist/esm/index.d.ts +11 -0
  203. package/dist/esm/index.js +11 -0
  204. package/dist/esm/package.json +1 -0
  205. package/dist/esm/predefined.d.ts +62 -0
  206. package/dist/esm/predefined.js +18 -0
  207. package/dist/esm/producer/index.d.ts +3 -0
  208. package/dist/esm/producer/index.js +1 -0
  209. package/dist/esm/producer/producer-implementation.d.ts +18 -0
  210. package/dist/esm/producer/producer-implementation.js +105 -0
  211. package/dist/esm/producer/producer.d.ts +44 -0
  212. package/dist/esm/producer/producer.js +1 -0
  213. package/dist/esm/producer/types.d.ts +70 -0
  214. package/dist/esm/producer/types.js +10 -0
  215. package/dist/esm/queue/index.d.ts +3 -0
  216. package/dist/esm/queue/index.js +1 -0
  217. package/dist/esm/queue/queue-implementation.d.ts +21 -0
  218. package/dist/esm/queue/queue-implementation.js +87 -0
  219. package/dist/esm/queue/queue.d.ts +55 -0
  220. package/dist/esm/queue/queue.js +1 -0
  221. package/dist/esm/queue/types.d.ts +25 -0
  222. package/dist/esm/queue/types.js +1 -0
  223. package/dist/esm/retry/default-retry-strategy.d.ts +9 -0
  224. package/dist/esm/retry/default-retry-strategy.js +5 -0
  225. package/dist/esm/retry/index.d.ts +4 -0
  226. package/dist/esm/retry/index.js +4 -0
  227. package/dist/esm/retry/retry-implementation.d.ts +18 -0
  228. package/dist/esm/retry/retry-implementation.js +40 -0
  229. package/dist/esm/retry/retry-strategy.d.ts +28 -0
  230. package/dist/esm/retry/retry-strategy.js +6 -0
  231. package/dist/esm/retry/time-strategies.d.ts +45 -0
  232. package/dist/esm/retry/time-strategies.js +24 -0
  233. package/dist/esm/types.d.ts +30 -0
  234. package/dist/esm/types.js +6 -0
  235. package/dist/esm/utils.d.ts +11 -0
  236. package/dist/esm/utils.js +72 -0
  237. package/package.json +101 -6
  238. package/.claude/settings.local.json +0 -13
  239. package/.idea/amqp-oop.iml +0 -15
  240. package/.idea/aws.xml +0 -11
  241. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  242. package/.idea/jsLibraryMappings.xml +0 -6
  243. package/.idea/jsLinters/eslint.xml +0 -6
  244. package/.idea/modules.xml +0 -8
  245. package/.idea/vcs.xml +0 -6
@@ -0,0 +1,194 @@
1
+ import * as amqp from 'amqplib';
2
+ import { Channel } from '../channel';
3
+ import { MaybePromise } from '../types';
4
+ /**
5
+ * How to handle Rabbit message when the processing fails (throws error).
6
+ */
7
+ export declare enum ConsumptionFailureStrategy {
8
+ /**
9
+ * Acknowledges the message as successfully processed even when the handler throws.
10
+ */
11
+ Drop = "Drop",
12
+ /**
13
+ * Rejects the message and returns it to the queue, so a different consumer can process it again.
14
+ */
15
+ Requeue = "Requeue",
16
+ /**
17
+ * Message is rejected and moved into dead letter queue if configured on the consuming queue.
18
+ */
19
+ Reject = "Reject"
20
+ }
21
+ /**
22
+ * How to handle messages batch when processing fails (throw error).
23
+ */
24
+ export declare enum BatchFailureStrategy {
25
+ /**
26
+ * Reject the whole batch; the consumer will not try to reprocess the messages.
27
+ * Each message in the batch is processed according to the `failureStrategy` property.
28
+ */
29
+ Fail = "Fail",
30
+ /**
31
+ * Split the batch into individual messages and try to process each message separately.
32
+ * The listener will be called for each message, where the batch passed into the listener
33
+ * consists only of the single message.
34
+ *
35
+ * If the processing of the message fails again, it is handled according to the `failureStrategy` property.
36
+ *
37
+ * Split strategy is not supported when the batch size is equal to 1.
38
+ */
39
+ Split = "Split"
40
+ }
41
+ export declare enum BatchState {
42
+ WaitingForData = "WaitingForData",
43
+ Processing = "Processing",
44
+ Failed = "Failed",
45
+ Processed = "Processed",
46
+ Acknowledging = "Acknowledging",
47
+ Acknowledged = "Acknowledged"
48
+ }
49
+ export type ConsumerCallbackArgs<Message, AdditionalProperties = Record<string, unknown>> = {
50
+ channel: Channel;
51
+ message: Message;
52
+ rabbitMessage: amqp.Message;
53
+ } & AdditionalProperties;
54
+ /**
55
+ * Arguments passed to a batch consumer callback.
56
+ * Contains the channel and an array of message entries, each holding the parsed payload,
57
+ * the raw amqplib message, and any additional properties added by the consumer implementation.
58
+ */
59
+ export type BatchConsumerCallbackArgs<Message, AdditionalProperties = Record<string, unknown>> = {
60
+ channel: Channel;
61
+ messages: Array<{
62
+ message: Message;
63
+ rabbitMessage: amqp.Message;
64
+ } & AdditionalProperties>;
65
+ };
66
+ export type ConsumerCallbackFn<Message, AdditionalProperties = Record<string, unknown>> = (args: ConsumerCallbackArgs<Message, AdditionalProperties>) => MaybePromise<void>;
67
+ /**
68
+ * Callback function type for a batch consumer handler.
69
+ * Receives a batch of messages along with their raw amqplib payloads and the channel.
70
+ */
71
+ export type BatchConsumerCallbackFn<Message, AdditionalProperties = Record<string, unknown>> = (args: BatchConsumerCallbackArgs<Message, AdditionalProperties>) => MaybePromise<void>;
72
+ export type ConsumerOptions<T> = {
73
+ /**
74
+ * How to handle a RabbitMQ message when the handler throws an error.
75
+ * Options are:
76
+ * - Drop: acknowledges the message as successfully processed even when the handler throws.
77
+ * - Requeue: rejects the message and returns it to the queue so a different consumer can process it.
78
+ * - Reject: rejects the message and moves it to the dead letter queue if one is configured.
79
+ */
80
+ failureStrategy?: ConsumptionFailureStrategy;
81
+ /**
82
+ * Function that parses the message received by Rabbit.
83
+ * By default it calls JSON.parse, but you may provide your own function to parse message in XML or Proto format.
84
+ * @param payload content of the rabbit message.
85
+ */
86
+ parseMessageFn?(payload: Buffer): MaybePromise<T>;
87
+ /**
88
+ * Options passed down into `amqplib.channel.consume` function.
89
+ * Auto acknowledgement is controlled by the `failureStrategy` property instead.
90
+ */
91
+ consumeOptions?: Omit<amqp.Options.Consume, 'noAck'>;
92
+ /**
93
+ * How many messages the RabbitMQ broker can send to the consumer in parallel.
94
+ * This effectively controls the concurrency of the consumer.
95
+ * Defaults to 0, which means the broker can send as many messages as it wants.
96
+ *
97
+ * Warning: prefetch is configured on the channel. It is recommended to use a separate channel
98
+ * per consumer so that different prefetch values do not interfere with each other.
99
+ */
100
+ prefetch?: number;
101
+ /**
102
+ * Channel to use for consuming. If `null` (default), a new dedicated channel is created.
103
+ */
104
+ channel?: Channel | null;
105
+ };
106
+ export type BatchConsumerOptions<T> = ConsumerOptions<T> & {
107
+ /**
108
+ * How many messages are in single batch. Consumer can process multiple batches in parallel,
109
+ * when prefetch is higher than the batch size.
110
+ *
111
+ * The batch can be smaller, for example when not enough messages were received during `maxWaitTimeForBatch`,
112
+ * or when `batchFailureStrategy` is set to `Split`.
113
+ *
114
+ * If not specified, prefetch size will be used as a batch size.
115
+ * If either batch size nor prefetch is specified, the default value is 20.
116
+ */
117
+ batchSize?: number;
118
+ /**
119
+ * Time in milliseconds to wait before process incomplete batch.
120
+ *
121
+ * When consumer doesn't have enough messages in buffer, it will wait
122
+ * specified number of milliseconds for new messages to arrive. If after
123
+ * the time there is still not enough messages, the consumer will invoke
124
+ * the listener with smaller batch.
125
+ *
126
+ * Effectively, this property controls for how long the message can be in buffer
127
+ * before the consumer invokes listener for it.
128
+ *
129
+ * By default is 100ms.
130
+ */
131
+ maxWaitTimeForBatch?: number;
132
+ /**
133
+ * After batch is successfully processed, and `failureStrategy` is not set to `Reject`,
134
+ * consumer needs to confirm messages to the RabbitMQ broker. If there is different batch,
135
+ * that has older messages than the current one, consumer will wait some time before
136
+ * acknowledge the messages (so the batch with older messages have some time to finish).
137
+ *
138
+ * Reasoning behind is that Rabbit allows to either acknowledge each message separately, or
139
+ * acknowledge sequential set of messages using single call (faster). When batch, that is not
140
+ * the oldest one, finish processing, this timeout allows it to wait for the oldest batch
141
+ * to complete, allowing consumer to acknowledge all the messages (both from the older batch,
142
+ * as well for the current) using single acknowledgement call.
143
+ *
144
+ * When the processed job is the oldest, this property doesn't delay the acknowledgement and the
145
+ * consumer acknowledge the whole batch right away using single call.
146
+ *
147
+ * If the older batches are not processed until the specified time, consumer acknowledge
148
+ * each message separately.
149
+ *
150
+ * The property allows to wait for acknowledgements only, rejections are send to the RabbitMQ
151
+ * broker immediately and there is currently no way to control it.
152
+ *
153
+ * This property effectively controls how long the message can wait before is acknowledge,
154
+ * but after it is processed by listener.
155
+ *
156
+ * The value is specified in milliseconds. Default value is 0, meaning the consumer
157
+ * doesn't wait for older batches to finish processing.
158
+ */
159
+ maxWaitTimeForAck?: number;
160
+ /**
161
+ * How to handle a batch of messages when processing fails (throws error).
162
+ * Options are:
163
+ * - Fail: reject the whole batch; the consumer will not try to reprocess the messages.
164
+ * - Split: split the batch into individual messages and try to process each one separately.
165
+ */
166
+ batchFailureStrategy?: BatchFailureStrategy;
167
+ };
168
+ export declare const DEFAULT_CONSUMER_OPTIONS: {
169
+ readonly failureStrategy: ConsumptionFailureStrategy.Reject;
170
+ readonly parseMessageFn: (payload: Buffer) => any;
171
+ readonly consumeOptions: {};
172
+ readonly prefetch: 0;
173
+ readonly batchSize: -1;
174
+ readonly maxWaitTimeForBatch: 100;
175
+ readonly maxWaitTimeForAck: 0;
176
+ readonly batchFailureStrategy: BatchFailureStrategy.Fail;
177
+ readonly channel: null;
178
+ };
179
+ export type BatchRecord = {
180
+ messages: Array<{
181
+ rabbitMessage: amqp.Message;
182
+ }>;
183
+ state: BatchState;
184
+ confirmTimer?: NodeJS.Timeout;
185
+ };
186
+ export type ConsumerWrapper<Callback> = {
187
+ callback: Callback;
188
+ amqpConsumer: amqp.Replies.Consume;
189
+ messagesInFlight: number;
190
+ isConnected: boolean;
191
+ };
192
+ export type BatchConsumerWrapper<Callback> = ConsumerWrapper<Callback> & {
193
+ batches: BatchRecord[];
194
+ };
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_CONSUMER_OPTIONS = exports.BatchState = exports.BatchFailureStrategy = exports.ConsumptionFailureStrategy = void 0;
4
+ var ConsumptionFailureStrategy;
5
+ (function (ConsumptionFailureStrategy) {
6
+ ConsumptionFailureStrategy["Drop"] = "Drop";
7
+ ConsumptionFailureStrategy["Requeue"] = "Requeue";
8
+ ConsumptionFailureStrategy["Reject"] = "Reject";
9
+ })(ConsumptionFailureStrategy || (exports.ConsumptionFailureStrategy = ConsumptionFailureStrategy = {}));
10
+ var BatchFailureStrategy;
11
+ (function (BatchFailureStrategy) {
12
+ BatchFailureStrategy["Fail"] = "Fail";
13
+ BatchFailureStrategy["Split"] = "Split";
14
+ })(BatchFailureStrategy || (exports.BatchFailureStrategy = BatchFailureStrategy = {}));
15
+ var BatchState;
16
+ (function (BatchState) {
17
+ BatchState["WaitingForData"] = "WaitingForData";
18
+ BatchState["Processing"] = "Processing";
19
+ BatchState["Failed"] = "Failed";
20
+ BatchState["Processed"] = "Processed";
21
+ BatchState["Acknowledging"] = "Acknowledging";
22
+ BatchState["Acknowledged"] = "Acknowledged";
23
+ })(BatchState || (exports.BatchState = BatchState = {}));
24
+ exports.DEFAULT_CONSUMER_OPTIONS = {
25
+ failureStrategy: ConsumptionFailureStrategy.Reject,
26
+ parseMessageFn: (payload) => JSON.parse(payload.toString()),
27
+ consumeOptions: {},
28
+ prefetch: 0,
29
+ batchSize: -1,
30
+ maxWaitTimeForBatch: 100,
31
+ maxWaitTimeForAck: 0,
32
+ batchFailureStrategy: BatchFailureStrategy.Fail,
33
+ channel: null,
34
+ };
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Thrown when a retryable operation exhausts all retry attempts
3
+ * as defined by the configured {@link RetryStrategy}.
4
+ */
5
+ export declare class TooManyRetriesError extends Error {
6
+ /**
7
+ * The last error thrown by the retried operation before retries were exhausted.
8
+ */
9
+ readonly cause: unknown;
10
+ constructor(message: string,
11
+ /**
12
+ * The last error thrown by the retried operation before retries were exhausted.
13
+ */
14
+ cause: unknown);
15
+ }
16
+ /**
17
+ * Thrown when the channel's internal write buffer does not drain
18
+ * within the configured drain timeout.
19
+ * The underlying amqplib channel is closed when this error is thrown.
20
+ */
21
+ export declare class DrainError extends Error {
22
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DrainError = exports.TooManyRetriesError = void 0;
4
+ class TooManyRetriesError extends Error {
5
+ constructor(message, cause) {
6
+ super(message);
7
+ this.cause = cause;
8
+ }
9
+ }
10
+ exports.TooManyRetriesError = TooManyRetriesError;
11
+ class DrainError extends Error {
12
+ }
13
+ exports.DrainError = DrainError;
@@ -0,0 +1,10 @@
1
+ import { Channel } from '../channel';
2
+ import { ExchangeImplementation } from './exchange-implementation';
3
+ /**
4
+ * Class representing the default, direct exchange created by the RabbitMQ broker.
5
+ * Every queue is automatically bound to this exchange under a routing key equal to the queue name.
6
+ * The exchange cannot be declared or removed; broker interaction is skipped entirely.
7
+ */
8
+ export declare class DefaultExchange extends ExchangeImplementation {
9
+ constructor(channel: Channel);
10
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DefaultExchange = void 0;
4
+ const types_1 = require("../types");
5
+ const exchange_implementation_1 = require("./exchange-implementation");
6
+ class DefaultExchange extends exchange_implementation_1.ExchangeImplementation {
7
+ constructor(channel) {
8
+ super(channel, '', 'direct', {
9
+ durable: true,
10
+ assertionMode: types_1.AssertionMode.Passive,
11
+ });
12
+ }
13
+ }
14
+ exports.DefaultExchange = DefaultExchange;
@@ -0,0 +1,24 @@
1
+ import { Channel } from '../channel';
2
+ import { Queue } from '../queue';
3
+ import { ProducerOptions, Producer } from '../producer';
4
+ import { BindingArgs, ExchangeConsumerQueueOptions, ExchangeConsumerOptions, ExchangeBatchConsumerOptions, ExchangeTypes, ExchangeOptions } from './types';
5
+ import { Exchange } from './exchange';
6
+ export declare class ExchangeImplementation implements Exchange {
7
+ protected readonly channel: Channel;
8
+ private readonly exchangeName;
9
+ private readonly exchangeType;
10
+ private readonly options?;
11
+ private assertPromise;
12
+ private bindings;
13
+ constructor(channel: Channel, exchangeName: string, exchangeType: ExchangeTypes, options?: ExchangeOptions);
14
+ assert(): Promise<this>;
15
+ name(): Promise<string>;
16
+ bindQueue(queue: Queue, pattern: string, args?: BindingArgs): Promise<this>;
17
+ bindExchange(exchange: Exchange, pattern: string, args?: BindingArgs): Promise<this>;
18
+ private rebind;
19
+ createConsumer<T>(options: ExchangeConsumerOptions<T>, queueOptions?: ExchangeConsumerQueueOptions): Promise<import("..").Consumer<T, Record<string, unknown>>>;
20
+ createBatchConsumer<T>(options: ExchangeBatchConsumerOptions<T>, queueOptions?: ExchangeConsumerQueueOptions): Promise<import("..").BatchConsumer<T, Record<string, unknown>>>;
21
+ createProducer<T>(options?: ProducerOptions<T> & {
22
+ isConfirmed?: boolean;
23
+ }): Promise<Producer<T>>;
24
+ }
@@ -0,0 +1,159 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.ExchangeImplementation = void 0;
16
+ const util_1 = require("util");
17
+ const safe_stable_stringify_1 = __importDefault(require("safe-stable-stringify"));
18
+ const producer_1 = require("../producer");
19
+ const utils_1 = require("../utils");
20
+ const types_1 = require("../types");
21
+ const types_2 = require("./types");
22
+ const debug = (0, util_1.debuglog)(`${utils_1.LIB_NAME}:exchange`);
23
+ const DEFAULT_EXCHANGE_OPTIONS = {
24
+ assertionMode: types_1.AssertionMode.Assert,
25
+ };
26
+ class ExchangeImplementation {
27
+ constructor(channel, exchangeName, exchangeType, options) {
28
+ this.channel = channel;
29
+ this.exchangeName = exchangeName;
30
+ this.exchangeType = exchangeType;
31
+ this.assertPromise = null;
32
+ this.bindings = [];
33
+ this.options = (0, utils_1.deepMerge)({}, DEFAULT_EXCHANGE_OPTIONS, options !== null && options !== void 0 ? options : {});
34
+ this.channel.on('close', () => {
35
+ debug('native-close');
36
+ this.assertPromise = null;
37
+ });
38
+ }
39
+ assert() {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ if (this.assertPromise) {
42
+ yield this.assertPromise;
43
+ return this;
44
+ }
45
+ this.assertPromise = (() => __awaiter(this, void 0, void 0, function* () {
46
+ var _a, _b, _c;
47
+ debug('assert name=%s type=%s mode=%s', this.exchangeName, this.exchangeType, (_a = this.options) === null || _a === void 0 ? void 0 : _a.assertionMode);
48
+ const channel = yield this.channel.native();
49
+ switch ((_b = this.options) === null || _b === void 0 ? void 0 : _b.assertionMode) {
50
+ case types_1.AssertionMode.Check:
51
+ yield channel.checkExchange(this.exchangeName);
52
+ debug('native-check-done name=%s', this.exchangeName);
53
+ break;
54
+ case types_1.AssertionMode.Assert:
55
+ yield channel.assertExchange(this.exchangeName, this.exchangeType, this.options);
56
+ debug('native-assert-done name=%s type=%s', this.exchangeName, this.exchangeType);
57
+ break;
58
+ case types_1.AssertionMode.Passive:
59
+ debug('no-assert name=%s mode=%s', this.exchangeName, this.options.assertionMode);
60
+ break;
61
+ default:
62
+ throw new Error(`Unknown assertion mode: ${(_c = this.options) === null || _c === void 0 ? void 0 : _c.assertionMode}`);
63
+ }
64
+ }))();
65
+ yield this.assertPromise;
66
+ yield this.rebind();
67
+ debug('assert-complete name=%s', this.exchangeName);
68
+ return this;
69
+ });
70
+ }
71
+ name() {
72
+ return __awaiter(this, void 0, void 0, function* () {
73
+ return this.assert().then(self => self.exchangeName);
74
+ });
75
+ }
76
+ bindQueue(queue, pattern, args) {
77
+ return __awaiter(this, void 0, void 0, function* () {
78
+ const [thisName, queueName] = yield Promise.all([
79
+ this.name(),
80
+ queue.name(),
81
+ ]);
82
+ debug('bind-queue exchange=%s queue=%s pattern=%s', thisName, queueName, pattern);
83
+ const doesBindingMatch = (binding) => binding.type === types_2.BindingType.queue &&
84
+ binding.pattern === pattern &&
85
+ binding.queue === queue &&
86
+ (0, safe_stable_stringify_1.default)(binding.args) === (0, safe_stable_stringify_1.default)(args);
87
+ if (this.bindings.every(binding => !doesBindingMatch(binding))) {
88
+ this.bindings.push({
89
+ args,
90
+ pattern,
91
+ type: types_2.BindingType.queue,
92
+ queue,
93
+ });
94
+ }
95
+ const channel = yield this.channel.native();
96
+ yield channel.bindQueue(queueName, thisName, pattern, args);
97
+ debug('bind-queue-done exchange=%s queue=%s pattern=%s', thisName, queueName, pattern);
98
+ return this;
99
+ });
100
+ }
101
+ bindExchange(exchange, pattern, args) {
102
+ return __awaiter(this, void 0, void 0, function* () {
103
+ const [thisName, exchangeName] = yield Promise.all([
104
+ this.name(),
105
+ exchange.name(),
106
+ ]);
107
+ debug('bind-exchange dest=%s source=%s pattern=%s', thisName, exchangeName, pattern);
108
+ const doesBindingMatch = (binding) => binding.type === types_2.BindingType.exchange &&
109
+ binding.pattern === pattern &&
110
+ binding.exchange === exchange &&
111
+ (0, safe_stable_stringify_1.default)(binding.args) === (0, safe_stable_stringify_1.default)(args);
112
+ if (this.bindings.every(binding => !doesBindingMatch(binding))) {
113
+ this.bindings.push({
114
+ args,
115
+ pattern,
116
+ type: types_2.BindingType.exchange,
117
+ exchange,
118
+ });
119
+ }
120
+ const channel = yield this.channel.native();
121
+ yield channel.bindExchange(exchangeName, thisName, pattern, args);
122
+ debug('bind-exchange-done dest=%s source=%s pattern=%s', thisName, exchangeName, pattern);
123
+ return this;
124
+ });
125
+ }
126
+ rebind() {
127
+ return __awaiter(this, void 0, void 0, function* () {
128
+ debug('rebind name=%s bindings=%d', this.exchangeName, this.bindings.length);
129
+ const promises = yield Promise.allSettled(this.bindings.map(binding => (binding.type === types_2.BindingType.queue
130
+ ? this.bindQueue(binding.queue, binding.pattern, binding.args)
131
+ : this.bindExchange(binding.exchange, binding.pattern, binding.args))));
132
+ const failedPromise = promises.find(p => p.status === 'rejected');
133
+ if (failedPromise) {
134
+ debug('rebind-failed error=%s', (0, utils_1.errToMessage)(failedPromise.reason));
135
+ throw failedPromise.reason;
136
+ }
137
+ debug('rebind-complete name=%s', this.exchangeName);
138
+ });
139
+ }
140
+ createConsumer(options_1) {
141
+ return __awaiter(this, arguments, void 0, function* (options, queueOptions = {}) {
142
+ const queue = yield this.channel.createQueue('', Object.assign(Object.assign({}, queueOptions), { durable: false, exclusive: true }));
143
+ yield this.bindQueue(queue, options.pattern, options.bindingArgs);
144
+ return queue.createConsumer(options);
145
+ });
146
+ }
147
+ createBatchConsumer(options_1) {
148
+ return __awaiter(this, arguments, void 0, function* (options, queueOptions = {}) {
149
+ const queue = yield this.channel.createQueue('', Object.assign(Object.assign({}, queueOptions), { durable: false, exclusive: true }));
150
+ yield this.bindQueue(queue, options.pattern, options.bindingArgs);
151
+ return queue.createBatchConsumer(options);
152
+ });
153
+ }
154
+ createProducer(options = {}) {
155
+ var _a;
156
+ return Promise.resolve(new producer_1.ProducerImplementation((_a = options.channel) !== null && _a !== void 0 ? _a : this.channel.connection.createChannel(options.isConfirmed), this, options));
157
+ }
158
+ }
159
+ exports.ExchangeImplementation = ExchangeImplementation;
@@ -0,0 +1,67 @@
1
+ import { Queue } from '../queue';
2
+ import { Consumer, BatchConsumer } from '../consumer';
3
+ import { ProducerOptions, Producer } from '../producer';
4
+ import { ExchangeConsumerQueueOptions, ExchangeConsumerOptions, ExchangeBatchConsumerOptions, BindingArgs } from './types';
5
+ export interface Exchange {
6
+ /**
7
+ * Verify the exchange against the broker, according to the configured `assertionMode`.
8
+ *
9
+ * - `Assert` (default) — declare the exchange; creates it if absent, throws on config mismatch.
10
+ * - `Check` — verify the exchange exists without creating it; throws if absent.
11
+ * - `Passive` — no-op; no network call is made.
12
+ *
13
+ * Subsequent calls return immediately once the first call completes successfully.
14
+ * Returns `this` to allow chaining.
15
+ */
16
+ assert(): Promise<Exchange>;
17
+ /**
18
+ * Returns the name of the exchange.
19
+ * Asserts the exchange first if it has not been asserted yet.
20
+ */
21
+ name(): Promise<string>;
22
+ /**
23
+ * Bind a queue to this exchange.
24
+ * Asserts the exchange first if it has not been asserted yet.
25
+ * @param queue - Queue to bind to this exchange.
26
+ * @param pattern - Routing key pattern under which to bind.
27
+ * @param args - Optional AMQP headers or x-arguments for the binding.
28
+ */
29
+ bindQueue(queue: Queue, pattern: string, args?: BindingArgs): Promise<Exchange>;
30
+ /**
31
+ * Bind another exchange to this exchange.
32
+ * Asserts the exchange first if it has not been asserted yet.
33
+ * @param exchange - Exchange to bind to this exchange.
34
+ * @param pattern - Routing key pattern under which to bind.
35
+ * @param args - Optional AMQP headers or x-arguments for the binding.
36
+ */
37
+ bindExchange(exchange: Exchange, pattern: string, args?: BindingArgs): Promise<Exchange>;
38
+ /**
39
+ * Creates a consumer for the current exchange.
40
+ * Internally asserts an exclusive queue and binds it to the exchange.
41
+ * Unless specified otherwise, uses the same channel as was used to declare the exchange.
42
+ * This is generally not recommended, as each consumer should have its own dedicated channel.
43
+ * Consider using `connection.createConsumerForExchange` instead.
44
+ */
45
+ createConsumer<T>(options: ExchangeConsumerOptions<T>, queueOptions?: ExchangeConsumerQueueOptions): Promise<Consumer<T>>;
46
+ /**
47
+ * Creates a batch consumer for the current exchange.
48
+ * Internally asserts an exclusive queue and binds it to the exchange.
49
+ * Unless specified otherwise, uses the same channel as was used to declare the exchange.
50
+ * This is generally not recommended, as each consumer should have its own dedicated channel.
51
+ * Consider using `connection.createBatchConsumerForExchange` instead.
52
+ */
53
+ createBatchConsumer<T>(options: ExchangeBatchConsumerOptions<T>, queueOptions?: ExchangeConsumerQueueOptions): Promise<BatchConsumer<T>>;
54
+ /**
55
+ * Creates a producer for the current exchange.
56
+ * Unless specified otherwise, uses the same channel as was used to declare the exchange.
57
+ * This is generally not recommended, as each producer should have its own dedicated channel.
58
+ * Consider using `connection.createProducerForExchange` instead.
59
+ *
60
+ * @param options - Optional producer options (serialization, routing key, hooks, …).
61
+ * Set `options.isConfirmed` to `true` to open the dedicated channel in confirm mode.
62
+ * Has no effect when `options.channel` is supplied.
63
+ */
64
+ createProducer<T>(options?: ProducerOptions<T> & {
65
+ isConfirmed?: boolean;
66
+ }): Promise<Producer<T>>;
67
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export { Exchange } from './exchange';
2
+ export { ExchangeImplementation } from './exchange-implementation';
3
+ export { ExchangeTypes, ExchangeOptions, ExchangeConsumerQueueOptions, ExchangeConsumerOptions, ExchangeBatchConsumerOptions } from './types';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExchangeImplementation = void 0;
4
+ var exchange_implementation_1 = require("./exchange-implementation");
5
+ Object.defineProperty(exports, "ExchangeImplementation", { enumerable: true, get: function () { return exchange_implementation_1.ExchangeImplementation; } });
@@ -0,0 +1,58 @@
1
+ import * as amqp from 'amqplib';
2
+ import { AssertionMode } from '../types';
3
+ import { ConsumerOptions, BatchConsumerOptions } from '../consumer';
4
+ import { Queue } from '../queue';
5
+ import { Exchange } from './exchange';
6
+ /**
7
+ * The type of exchange to create. Accepted values: `'direct'`, `'fanout'`, `'topic'`, `'headers'`, `'match'`.
8
+ *
9
+ * Passed as the second argument to `channel.assertExchange` in the amqplib API.
10
+ *
11
+ * @see https://amqp-node.github.io/amqplib/channel_api.html
12
+ */
13
+ export type ExchangeTypes = Parameters<amqp.Channel['assertExchange']>[1];
14
+ /**
15
+ * Options for the auto-created exclusive queue when consuming from an exchange.
16
+ * The `durable` and `exclusive` fields are omitted because they are managed internally.
17
+ */
18
+ export type ExchangeConsumerQueueOptions = Omit<amqp.Options.AssertQueue, 'durable' | 'exclusive'>;
19
+ export type ExchangeConsumerBindingOptions = {
20
+ pattern: string;
21
+ bindingArgs?: BindingArgs;
22
+ };
23
+ /**
24
+ * Options for consuming messages from an exchange.
25
+ * Combines binding options (`pattern`, optional `bindingArgs`) with standard {@link ConsumerOptions}.
26
+ */
27
+ export type ExchangeConsumerOptions<T> = ExchangeConsumerBindingOptions & ConsumerOptions<T>;
28
+ /**
29
+ * Options for batch-consuming messages from an exchange.
30
+ * Combines binding options (`pattern`, optional `bindingArgs`) with standard {@link BatchConsumerOptions}.
31
+ */
32
+ export type ExchangeBatchConsumerOptions<T> = ExchangeConsumerBindingOptions & BatchConsumerOptions<T>;
33
+ export type BindingArgs = Record<string, string | number | boolean>;
34
+ export declare enum BindingType {
35
+ queue = "queue",
36
+ exchange = "exchange"
37
+ }
38
+ type Pattern = string;
39
+ export type Binding = {
40
+ pattern: Pattern;
41
+ args?: BindingArgs;
42
+ } & ({
43
+ type: BindingType.queue;
44
+ queue: Queue;
45
+ } | {
46
+ type: BindingType.exchange;
47
+ exchange: Exchange;
48
+ });
49
+ export type ExchangeOptions = amqp.Options.AssertExchange & {
50
+ /**
51
+ * Controls how the exchange is verified against the broker when `assert()` is called.
52
+ * Defaults to `AssertionMode.Assert`.
53
+ *
54
+ * @see AssertionMode
55
+ */
56
+ assertionMode?: AssertionMode;
57
+ };
58
+ export {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BindingType = void 0;
4
+ var BindingType;
5
+ (function (BindingType) {
6
+ BindingType["queue"] = "queue";
7
+ BindingType["exchange"] = "exchange";
8
+ })(BindingType || (exports.BindingType = BindingType = {}));
@@ -0,0 +1,7 @@
1
+ export * from './test-connection';
2
+ export * from './test-channel';
3
+ export * from './test-exchange';
4
+ export * from './test-queue';
5
+ export * from './test-consumer';
6
+ export * from './test-batch-consumer';
7
+ export * from './test-producer';
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./test-connection"), exports);
18
+ __exportStar(require("./test-channel"), exports);
19
+ __exportStar(require("./test-exchange"), exports);
20
+ __exportStar(require("./test-queue"), exports);
21
+ __exportStar(require("./test-consumer"), exports);
22
+ __exportStar(require("./test-batch-consumer"), exports);
23
+ __exportStar(require("./test-producer"), exports);