Add pollInterval option to mqSubscriptions #1021
parent
cf054fa186
commit
9e3fe5db73
|
@ -30,6 +30,7 @@ export type EventHookT = {
|
|||
type MQSubscription = {
|
||||
queue: string;
|
||||
batchSize?: number;
|
||||
pollInterval?: number;
|
||||
autoAck?: boolean;
|
||||
};
|
||||
export type MQHookT = {
|
||||
|
|
|
@ -52,12 +52,13 @@ export class MQHook implements Hook<MQHookT> {
|
|||
const subscriptions = functionDef.mqSubscriptions;
|
||||
for (const subscriptionDef of subscriptions) {
|
||||
const queue = subscriptionDef.queue;
|
||||
// console.log("Subscribing to queue", queue);
|
||||
// console.log("Subscribing to queue", queue, subscriptionDef);
|
||||
this.subscriptions.push(
|
||||
this.mq.subscribe(
|
||||
queue,
|
||||
{
|
||||
batchSize: subscriptionDef.batchSize,
|
||||
pollInterval: subscriptionDef.pollInterval,
|
||||
},
|
||||
async (messages: MQMessage[]) => {
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue