question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

kombu.common.Broadcast does not accept custom queue name

See original GitHub issue

the following happens at the moment

>>> import kombu.common
>>> queue_name = 'my_unique_queue'
>>> bcast = kombu.common.Broadcast(name='foo', queue=queue_name)
>>> bcast.queue == queue_name
False

This behavior is inconsistent with the docs for the class which claims that you can pass along a queue name to override the default behavior of generating a unique one.

This, in turn, makes using kombu.common.Broadcast with celery.Celerty.conf.task_queues and celery.Celerty.conf.task_routes impossible since the queue is always different.

changing the following line https://github.com/celery/kombu/blob/d78a8fc7a7b19d5c510e194a06a2280c99a88af4/kombu/common.py#L90

to

    if queue is None:
        queue = '{0}.{1}'.format(queue or 'bcast', uuid())

resolves the issue, however.

I can make a PR if there’s interest.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
clokepcommented, May 2, 2019

I think I’ll introduce a unique keyword argument instead… That way, if you want to, you’ll be able to create a queue per worker and have it bound to that exchange.

Just spent a few minutes tracking down where this was done, so for posterity this feature was introduced in #1033.

1reaction
thedrowcommented, Mar 27, 2019

I think I’ll introduce a unique keyword argument instead… That way, if you want to, you’ll be able to create a queue per worker and have it bound to that exchange.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Common Utilities - kombu.common - Celery
Convenience class used to define broadcast queues. Every queue instance will have a unique name, and both the queue and exchange is configured...
Read more >
start celery worker and enable it for broadcast queue
Suggestion: replace 'my_queue' with a new broadcast queue name, and start your worker processes with '-Q new_broadcast_queue_name', have a try.
Read more >
Kombu Documentation - Read the Docs
Queues receive messages sent to exchanges. The queues are declared by consumers. • Routing keys. Every message has a routing key.
Read more >
Change history — Kombu 5.2.4 documentation - Celery
Specifying names for broadcast queues now work as expected. Previously, named broadcast queues did not create multiple queues per worker. They incorrectly ...
Read more >
Routing Tasks — Celery 4.2.0 文档
Alternate routing concepts like topic and fanout is not available for all transports, ... Defining queues; Specifying task destination; Routers; Broadcast ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found