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