Add pollInterval option to mqSubscriptions #1021

pull/1054/head
Zef Hemel 2024-08-18 12:36:23 +02:00
parent cf054fa186
commit 9e3fe5db73
2 changed files with 3 additions and 1 deletions

View File

@ -30,6 +30,7 @@ export type EventHookT = {
type MQSubscription = {
queue: string;
batchSize?: number;
pollInterval?: number;
autoAck?: boolean;
};
export type MQHookT = {

View File

@ -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 {