Linked Questions

Popular Questions

I'm facing an issue where I'm unable to see the information about my queue in the RabbitMQ broker, but I can see the information in my Celery task console. I'm using Celery as a distributed task queue system with RabbitMQ as the message broker.

Here are the details of the problem:

I have verified that my Celery tasks are running and processing correctly. I can see the expected output and log messages in the Celery task console. However, when I access the RabbitMQ management interface or use command-line tools to inspect the queues, I cannot find the queue associated with my Celery tasks. Other queues and exchanges are visible in the RabbitMQ management interface. I have already checked the following:

Verified that the RabbitMQ connection details (hostname, port, credentials) used by Celery are correct. Confirmed that the virtual host configured in Celery matches the one used in the RabbitMQ broker. Ensured that I have the necessary permissions and access rights to view queues in the RabbitMQ broker.

this is my code. celery task

app = Celery('simple_worker', broker='amqp://guest@localhost:5672//')
rabbitmq_config = RabbitMQConfig()
@app.task
def publish_payment_data(payment_data):
    return json.dumps(payment_data)

I call the task within this function.

appli = Celery('hello', broker='amqp://guest@localhost:5672//')


def call_method(payment_data):
    logger.info('invoking message')
    r = appli.send_task('send_payment_data.publish_payment_data', kwargs={'payment_data':payment_data})
    return r.id


payment_data = {"patient_id":58, "amount": 5000}

print(call_method(payment_data))

this is my celery worker console

[tasks]
  . send_payment_data.publish_payment_data

[2023-05-26 15:47:50,685: INFO/MainProcess] Connected to amqp://guest:**@127.0.0.1:5672//
[2023-05-26 15:47:50,706: INFO/MainProcess] mingle: searching for neighbors
[2023-05-26 15:47:52,629: INFO/MainProcess] mingle: all alone
[2023-05-26 15:47:52,771: INFO/MainProcess] celery@rodolphe ready.
[2023-05-26 15:48:08,430: INFO/MainProcess] Task send_payment_data.publish_payment_data[a14bbbba-8ec0-4775-bfee-f43e50109b9b] received
[2023-05-26 15:48:08,440: INFO/ForkPoolWorker-1] Task send_payment_data.publish_payment_data[a14bbbba-8ec0-4775-bfee-f43e50109b9b] succeeded in 0.00268172100004449s: '{"patient_id": 58, "amount": 5000}'

this my rabbitmq dashboard enter image description here

Related Questions