@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 +3 -3
- package/dist/index.js +1 -6
- package/package.json +1 -1
- package/src/index.ts +1 -9
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<
|
|
54
|
-
bindQueue(queue: string, exchange: string): Promise<
|
|
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<
|
|
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
|
-
|
|
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
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
|
-
|
|
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
|
]);
|