@autofleet/rabbit 2.1.8-beta10 → 2.1.8-beta4

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/dist/index.d.ts CHANGED
@@ -50,13 +50,13 @@ declare class RabbitMq implements IAfRabbitMq {
50
50
  getNewChannel(): Promise<ChannelWrapper>;
51
51
  assertChannel(): Promise<ChannelWrapper>;
52
52
  assertExchange(exchangeName: string, options?: any): Promise<any>;
53
- getQueueLength(queue: string): Promise<import("amqplib").Replies.AssertQueue>;
54
- bindQueue(queue: string, exchange: string): Promise<void>;
53
+ getQueueLength(queue: string): Promise<any>;
54
+ bindQueue(queue: string, exchange: string): Promise<any>;
55
55
  assertQueue(queue: string, options?: Options.AssertQueue): Promise<void>;
56
56
  consume(queue: string, callback: (msg: any, ack: Function, nack: Function) => any, options?: any): Promise<void>;
57
57
  consumeFromExchange(queue: string, exchange: string, callback: (msg: any, ack: Function, nack: Function) => any, options?: any): Promise<void>;
58
58
  publish(exchange: string, content: any, customHeaders?: any): Promise<unknown>;
59
- sendToQueue(queue: string, content: any, options?: any, customHeaders?: any): Promise<boolean>;
59
+ sendToQueue(queue: string, content: any, options?: any, customHeaders?: any): Promise<void>;
60
60
  isConnected(): Promise<boolean>;
61
61
  }
62
62
  export default RabbitMq;
package/dist/index.js CHANGED
@@ -229,12 +229,7 @@ class RabbitMq {
229
229
  if (!shouldConsume) {
230
230
  return this.ack(channel)(msg);
231
231
  }
232
- try {
233
- yield callback(parsedMessage, this.ack(channel, true), this.nack(channel, queue, optionsWithDefaults, { messageTtl: deadMessageTtl }));
234
- }
235
- catch (e) {
236
- yield this.nack(channel, queue, optionsWithDefaults, { messageTtl: deadMessageTtl });
237
- }
232
+ callback(parsedMessage, this.ack(channel, true), this.nack(channel, queue, optionsWithDefaults, { messageTtl: deadMessageTtl }));
238
233
  })),
239
234
  ]);
240
235
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autofleet/rabbit",
3
- "version": "2.1.8-beta10",
3
+ "version": "2.1.8-beta4",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -259,15 +259,7 @@ class RabbitMq implements IAfRabbitMq {
259
259
  if (!shouldConsume) {
260
260
  return this.ack(channel)(msg);
261
261
  }
262
- try {
263
- await callback(
264
- parsedMessage,
265
- this.ack(channel, true),
266
- this.nack(channel, queue, optionsWithDefaults, { messageTtl: deadMessageTtl }),
267
- );
268
- } catch (e) {
269
- await this.nack(channel, queue, optionsWithDefaults, { messageTtl: deadMessageTtl });
270
- }
262
+ callback(parsedMessage, this.ack(channel, true), this.nack(channel, queue, optionsWithDefaults, { messageTtl: deadMessageTtl }));
271
263
  },
272
264
  ),
273
265
  ]);