What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hi, Is there a way to make RabbitMQ Queues default to Lazy?

U03PF6138LV
U03PF6138LV Posts: 12 🧑🏻‍🚀 - Cadet

Hi,
Is there a way to make RabbitMQ Queues default to Lazy?

Comments

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice

    Locally using docker-sdk?
    In our PaaS they are lazy by default but RMQ is deployed a bit differently than locally using docker-sdk.

  • giovanni.piemontese
    giovanni.piemontese Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    yes it is possible...
    in src/Pyz/Client/RabbitMq/RabbitMqConfig.php add this method:

        /**
         * @param string $queueName
         * @param string $routingKey
         *
         * @return \Generated\Shared\Transfer\RabbitMqOptionTransfer
         */
        protected function createQueueOptionTransfer($queueName, $routingKey = ''): RabbitMqOptionTransfer
        {
            $queueOptionTransfer = parent::createQueueOptionTransfer($queueName, $routingKey);
    
            $queueOptionTransfer->setArguments(['x-queue-mode' => 'lazy']);
    
            return $queueOptionTransfer;
        }
    

    IMPORTANTE: U have to remove all queues before this changes are applied and queue:setup called...

  • UP8T3GKFH
    UP8T3GKFH Posts: 56 🧑🏻‍🚀 - Cadet

    In my opinion, you should be careful about setting all queues to 'lazy' mode. This is because all messages are then saved on the data storage medium. Especially in the 'sync.*'. queues, depending on the amount of data in the shop, there can be several 100K messages. This could be a performance impact.