celery / kombu

Messaging library for Python.
http://kombu.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
2.86k stars 927 forks source link

Bus Transport #1146

Open konstantin-Sk opened 4 years ago

konstantin-Sk commented 4 years ago

Hello. I've some problem with using Azure Bus (https://kombu.readthedocs.io/en/latest/reference/kombu.transport.azureservicebus.html) as transport. Here [https://kombu.readthedocs.io/en/latest/userguide/examples.html] you have two example. First one (hello world) works good with default url from example and with Azure Bus connection string, but second example refuse to work if instead of ampq.... connection url I enter Bus connection url. I cant find any clue in documentation about how to solve\fix it.

konstantin-Sk commented 4 years ago

There are some kind of work-around or fix (I'm still not sure what is it), that I manage to find:

  1. In client.py import task queues: from queues import task_queues
  2. In client.py add priority_to_queue dictionary: priority_to_queue = { 'high': task_queues[0], 'mid': task_queues[1], 'low': task_queues[2], } and after line with routing_key = priority_to_routing_key[priority] add new line queue = priority_to_queue[priority]
  3. In client.py in .publish replace declare=[exchange] with declare=[queue],

After this steps I managed to receive a task. But I want to know - is this a right way of fixing problem, or it is just some kind of using code in inappropriate way?


Edit 1.0 Actually step 2 might be skipped and in step №3 can be used declare=task_queues, to replace original string.

auvipy commented 4 years ago

can you send a PR?