T
T
tigra2018-08-09 10:42:37
Yii
tigra, 2018-08-09 10:42:37

How to dequeue RabbitMQ on error in Yii2?

I am using the queue component.

'components' => [
    'queue' => [
            'class' => 'yii\queue\amqp_interop\Queue',
            'host' => 'localhost',
            'user' => 'guest',
            'password' => 'guest',
            'queueName' => 'queue_log_user',
    ],
]

add to queue like this
Yii::$app->queue->push(new UserLogJob(['data' => [
            'ip' => $this->ip,
            'user_agent' => $this->userAgent,
            'created_at' => time(),
]]));

With any error, the queue freezes and the whole thing slows down, how can I remove a position from the queue for any action?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question