so would me setting broker pool limit to 1 account for this
because it wasn't being honoured
previously
diogobaeder joined the channel
cmwslw joined the channel
diogobaeder
Hi guys! Hey, can anyone help me with using "headers" exchanges with Celery 2.5? I can't get it working at all :-(
cmwslw
Is it ridiculous to use a RabbitMQ server with the only worker being itself?
Basically, I'm looking for a queue with a nice interface.
nanonyme
Imo not
cmwslw
nanonyme: is that to me?
Right now I can't see myself expanding to other worker servers, but I guess that might be a nice plus
flashingpumpkin is now known as fpk^away
asksol
cmwslw: no, even one worker is useful
myusuf3: a pool limit of 1 means it will use one connection
cmwslw
asksol: Ok, just wondering if I was doing it way wrong
asksol
myusuf3: substantial drift is interesting, but not critical. would be interesting with some stats for that
myusuf3: it means that the clocks are out of sync, but also maybe it just received it too late
hard to know the difference ;)
diogobaeder
Regarding "headers" exchanges, does anyone know where there's an example of how to use them with Celery? I can't get it to work here, no matter what I set in my CELERY_QUEUES
asksol
if it's on the same machine then it's definitely the latter
sandywalsh_ joined the channel
diogobaeder: no example afaik, I don't remember if .apply_async forwards the headers argument
diogobaeder: you should try setting envvar KOMBU_LOG_DEBUG=1 to see what the kombu calls ends up being
adm joined the channel
ninkotech_ joined the channel
e.g. KOMBU_LOG_DEBUG=1 python; >>> add.apply_async(exchange='hhh', headers={...})
caleb_` joined the channel
diogobaeder
asksol, ah, interesting, thanks. Alternatively, is there any example of setting up the exchanges, queues and bindings manually, by using the AMQP classes directly?
asksol
diogobaeder: if headers is not passed then you can add it to extract_exec_options in celery/app/task.py and open an issue
diogobaeder: not sure what you mean by manually, but if you mean using the channel directly then no
diogobaeder
asksol, ack, thanks. But how do I define the bindings with the appropriate arguments, in order to go through the "headers" matchers?
Ah, k
caleb_ has quit
Kronuz has quit
sandywalsh has quit
fidothe has quit
Maior has quit
ninkotech__ has quit
asksol
you can subclass Queue's .declare method and add that to CELERY_QUEUES
caleb_` is now known as caleb_
but should be able to use the existing Queue
Kronuz joined the channel
message144 joined the channel
Exchange has a new passive attribute in kombu master, that could be added to Queue as well
diogobaeder
asksol, interesting, but even in 2.5? 2.5 doesn't accept Queue instances in the CELERY_QUEUES config, does it?
asksol
diogobaeder: no, not on 2.5 that's true
diogobaeder
Btw, CELERY_QUEUES should accept "arguments" items in each queue dict, shouldn't it? It doesn't seem to be passing them to Kombu
asksol
I did try using header exchanges with celery 2.x so should be possible
someone should document this, it's still in use by the add_consumer control command
diogobaeder
asksol, thanks, I'll try with queue_arguments and binding_arguments, as with exchange_arguments it didn't work
asksol, one more question, sorry to bother you with this: how do I use current_app.send_task, to send a message, but specifying only the exchange to send to and the appropriate arguments, but not the specific queue to which it should route the message?
I want the message to be routed according to the headers arguments
If I try specifying the exchange in the args for the method call, all I get is "celery.exceptions.QueueNotFound: "Queue 'celery' is not defined in CELERY_QUEUES""
asksol
diogobaeder: the queue= argument makes it take default arguments from the dict in CELERY_QUEUES
so just specify exchange and other options directly and omit the queue