Dramatq - Consumer encountered a connection error

688 Views Asked by At

When I try to run dramatiq from the command line, it gives me the below error. I'm currently using RabbitMQ.

[Thread-2] [dramatiq.worker.ConsumerThread(default)] [CRITICAL] Consumer encountered a connection error: (406, "PRECONDITION_FAILED - inequivalent arg 'x-dead-letter-routing-key'for queue 'default' in vhost '/': received the value 'default.XQ' of type 'longstr' but current is none")

This is what I have done until now.

import dramatiq
from dramatiq import get_logger


logger = get_logger(__name__)

@dramatiq.actor
    def myfunction():
1

There are 1 best solutions below

0
Pritam Pradhan On

Did you start the RabbitMQ Server? I got the same error as you, I fixed it by starting the RabbitMQ broker server first, before running the worker. The RabbitMQ server is in a package called rabbitmq-server in the Advanced Package Tool. But maybe different in other package managers.