kombu.common.Broadcast does not accept custom queue name
See original GitHub issuethe 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:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just spent a few minutes tracking down where this was done, so for posterity this feature was introduced in #1033.
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.