From a5a348445a3daf7306f864764a74d4461c329c63 Mon Sep 17 00:00:00 2001 From: Rahul Sethuram Date: Wed, 17 May 2023 21:55:12 +0400 Subject: [PATCH] Testnet (#4264) * feat: do not cache the sdks to make it possible to have different client configs in one runtime * put back yarn release and yarnrc * v2.0.3: stable version release * v2.0.3-alpha.1 alpha release * v2.0.4-alpha.1 alpha release fix: release version * v2.0.4-alpha.2 alpha release * Add ERD for reference * WIP: sdk-server * fix: handle empty chainData cases. * Update fastpath.ts * rmv: mnemonic (#4230) * remove mnemonic * increase timeouts (#4226) * Sequencer cache persists (#4245) * feat: add expiry time for executor cache * fix test * Batch pulling from the rabbitmq using amqplib (#4216) * feat: pull data from the queue in batch * revert * feat: move executor params to config * fix: integration config * rm * fix: test * Lint * ci(test): no need to include it * fix: queue limit setup --------- Co-authored-by: kristohberg Co-authored-by: sanchaymittal Co-authored-by: just-a-node Co-authored-by: carlomazzaferro Co-authored-by: wanglonghong --- packages/agents/sequencer/src/sequencer.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/agents/sequencer/src/sequencer.ts b/packages/agents/sequencer/src/sequencer.ts index 298d4032e6..a5ac80c0a5 100644 --- a/packages/agents/sequencer/src/sequencer.ts +++ b/packages/agents/sequencer/src/sequencer.ts @@ -95,11 +95,16 @@ export const makeSubscriber = async () => { ); if (context.config.messageQueue.subscriber) { - await channel.assertQueue(context.config.messageQueue.subscriber, { durable: true }); const binding = context.config.messageQueue.bindings.find( (it) => it.target == context.config.messageQueue.subscriber, ); - if (binding) { + const queue = context.config.messageQueue.queues.find((it) => it.name == context.config.messageQueue.subscriber); + + if (binding && queue) { + await channel.assertQueue(context.config.messageQueue.subscriber, { + durable: true, + maxLength: queue.queueLimit, + }); await channel.bindQueue(context.config.messageQueue.subscriber, binding?.exchange, binding?.keys[0]); } @@ -108,7 +113,8 @@ export const makeSubscriber = async () => { // By default subscribe to all configured queues concurrently await Promise.all( context.config.messageQueue.bindings.map(async (binding) => { - await channel.assertQueue(binding.target, { durable: true }); + const queue = context.config.messageQueue.queues.find((it) => it.name == binding.target); + await channel.assertQueue(binding.target, { durable: true, maxLength: queue?.queueLimit }); await channel.bindQueue(binding.target, binding.exchange, binding.keys[0]); }), );