#rabbitmq IRC Log

Index

IRC Log for 2011-11-16

Timestamps are in GMT/BST.

[4:30] <hofmeister> Hi - I'm trying to figure out wether or not rabbitmq supports priority as per the AMQP specs… Google tells me it does not - however the rabbitmq docs indicates it now does?
[7:24] <antares_> hofmeister: rabbitmq does not use priority field in any way, it is up for your applications to decide how to use it
[7:26] <hofmeister> Ok thanks :)
[8:48] <sampo_v2> hi. are you aware that ubuntu 11.10 with rabbitmq server installed do not shut down properly?
[8:49] <sampo_v2> this was the case with 2.6.1 and 2.7.0
[8:50] <antares_> sampo_v2: please post your findings to rabbitmq-discuss
[8:50] <sampo_v2> antares_: i don't really have any findings. this is just the case. there is also a confirmed ubuntu launchpad bug about this: https://bugs.launchpad.net/ubuntu/+source/rabbitmq-server/+bug/670289
[8:51] <sampo_v2> antares_: but sure. i can post a message
[9:00] <sampo_v2> done
[16:19] <andreys> hey all, got some stupid problem with basic functioning, need some help
[16:19] <andreys> I use rabbitmq via amqp php extension
[16:20] <andreys> in script1 I declare a durable and direct exchange
[16:21] <andreys> and publish to it via some routing key ("111")
[16:21] <andreys> it's name is SomeExchange
[16:22] <andreys> then in script2 I declare a queue called SomeQueue and bind it to (SomeExchange, routing key "111")
[16:22] <andreys> so far so good, when I publish in script1 I get it in script2
[16:22] <andreys> but for some reason if script2 changes its routing key to 222 it still receives all messages
[16:23] <andreys> and received message contain routing key '111'
[16:23] <andreys> why's that?
[16:23] <antares_> andreys: can they be "old" messages?
[16:23] <antares_> andreys: that were routed to that queue previously?
[16:23] <antares_> routing and consuming messages are two different things in the AMQP model
[16:23] <andreys> I don't think so, I'm testing with messages consisting of hour:minute:second
[16:24] <andreys> and when I execute publish, I clearly and immediately see it in other console
[16:24] <antares_> are you sure it is a direct exchange?
[16:24] <antares_> can it be that it is a fanout?
[16:24] <antares_> (that ignored routing keys)
[16:25] <antares_> *which
[16:25] <andreys> let me check
[16:26] <andreys> hmmmmm
[16:26] <andreys> wait a minute
[16:26] <andreys> I've got another question :)
[16:26] <andreys> if I at some point declare some exchange
[16:26] <andreys> then every script dies, then redeclares it with some other type
[16:27] <andreys> it doesn't change its type inside of rabbitmq, does it?...
[16:27] <antares_> rabbitmq will raise an exception
[16:27] <antares_> with the code 406
[16:28] <antares_> so no, you cannot redeclare it with different attributes
[16:28] <antares_> you can delete it and then redeclare or redeclare with exactly the same attributes
[16:28] <antares_> it would be a bit weird if your php library did not indicate this exception somehow
[16:28] <andreys> let me try it
[16:29] <andreys> do I get it right that both exchanges and queues doesn't have to be redeclared each time a script is run?
[16:30] <andreys> I'm talking about classic web scripting - script runs, dies, then next request runs the whole thing from the top again, everything's stateless (in simplest case)
[16:33] <andreys> well, it actually raises an exception - cannot redeclare exchange with different param
[16:34] <antares_> andreys: ok
[16:35] <antares_> andreys: well, AMQP apps are usually long lived but redeclaring entities over and over is fine as long as your apps agree on the attributes
[16:36] <andreys> yeah, I see
[16:36] <andreys> but why that queue keeps getting messages with different routing key...
[16:37] <andreys> $this->queue->declare('vkApiQueue'); $this->queue->bind('vkApi', $this->config['params']['suffix']);
[16:37] <andreys> something wrong with this sequence, perhaps?
[16:38] <antares_> I am not really familiar with this library but it looks correct
[16:38] <antares_> I suggest you do this
[16:38] <antares_> install RabbitMQ management UI plugin
[16:38] <antares_> and see all exchanges, bindings and so on easily in the browser
[16:38] <antares_> with rabbitmq 2.7 installing plugins is a breeze
[16:39] <antares_> rabbitmq-plugins enable [plugin name]
[16:39] <antares_> rabbitmq-plugins list will list available options
[16:39] <andreys> a-ha! let my try it
[16:39] <antares_> http://www.rabbitmq.com/plugins.html
[16:40] <antares_> also, maybe http://bit.ly/amqp-model-explained will help. It's a quick read.
[16:40] <andreys> thanks a lot, I think this'll help me
[16:41] <andreys> actually I found rabbitmqctl which can list queues and exchanges too
[16:41] <andreys> it made me think - different receivers could have same queue name or not?
[16:42] <andreys> receivers = consumers
[16:42] <antares_> yes, consumers can share a queue
[16:42] <antares_> messages will then be distributed between them in the round-robin manner
[16:43] <antares_> although there is a way to specify "weights" and load balance messages
[16:43] <andreys> so it doesn't take a routing key in comparison when consuming?
[16:43] <andreys> well I think I get it
[16:44] <antares_> this is described in http://www.rabbitmq.com/tutorials/tutorial-two-python.html and http://rubydoc.info/github/ruby-amqp/amqp/master/file/docs/Queues.textile#Using_multiple_consumers_per_queue
[16:44] <andreys> or no I don't :) see - they do get distributed
[16:44] <andreys> alright, reading..
[16:44] <antares_> andreys: routing key is used for routing
[16:45] <antares_> consumers have messaged pushed to them or fetch them as needed from queues
[17:15] <andreys1> antares_: I think now I got it:
[17:16] <andreys1> I had both instances of long running consumers declare a queue with same name and different routing key
[17:17] <andreys1> so I think what I had after that - that either one or another got a message with routing key designed for first one - is because queue name was the same
[17:17] <andreys1> and it basically had "2 routes from JFK" to the same "destination"
[17:18] <antares_> :)
[17:18] <andreys1> 2 bindings for the same queue, so it got through by first binding with first routing key, but got consumed by second since it effectively asked to fetch him everything in that queue
[17:18] <andreys1> am I right?
[17:18] <antares_> yes, this may be the case
[17:19] <antares_> rabbitmq only need to find one binding for a specific queue
[17:19] <andreys1> *so it got through - so messages with routing key for first instance got through
[17:19] <antares_> as long as there is one, the message is routed
[17:19] <antares_> and then consumers will be delivered every message that lands on their queue of interest
[17:19] <andreys1> ..regardless of routing key, right?
[17:20] <andreys1> because it is regarded only when message is being routed, not when message is consumed
[17:20] <andreys1> right?
[17:20] <antares_> right
[17:20] <andreys1> oh I'm so happy
[17:20] <antares_> andreys1: see basic.consume here: http://www.rabbitmq.com/amqp-0-9-1-reference.html#class.basic
[17:20] <antares_> it has no routing key attribute
[17:20] <andreys1> thanks a ton :) It always feels so good when all bricks finally are in their places :)
[17:21] <antares_> this is the method clients use to subscribe for "push notifications" from queues
[17:21] <andreys1> I don't think I got one in my binding for amqp in php
[17:21] <antares_> andreys1: no problem.
[17:21] <antares_> andreys1: yes, that's what I am saying
[17:21] <antares_> if AMQP operation doesn't carry some attribute, you can be pretty sure it is not used by that operation ;)
[17:22] <antares_> clients sometimes make things a bit confusing by inventing their own terminology :(
[17:22] <antares_> but I see that this php library is good in this regard
[17:22] <andreys1> you're talking about this one? php.net/amqp
[17:22] <antares_> not sure which one you demonstrated
[17:22] <andreys1> because there are afaik 2 libs of the same name
[17:22] <antares_> the one you are using
[17:22] <andreys1> I'm using that one
[17:23] <antares_> andreys1: I am aware of https://github.com/videlalvaro/php-amqplib
[17:23] <antares_> andreys1: and the guy who maintains that library is the author of RabbitMQ in Action. So you can be sure it is pretty decent.
[17:24] <antares_> maybe php.net/amqp is just as good, I only have experience with 2 ruby clients I maintain as well as the official java one and my clojure client
[17:24] <andreys1> I think I discarded it since it doesn't have persistent connections
[17:24] <antares_> hm, how come?
[17:25] <andreys1> as far as I understand the whole model, you cannot achieve persistent connections in PHP
[17:25] <antares_> ahh
[17:25] <andreys1> without tricks like fcgi
[17:25] <antares_> hm, when embedded in apache or in general?
[17:25] <andreys1> because script just dies when it is finished and that's it
[17:25] <antares_> I thought when you run php standalone it is not really different from ruby or perl
[17:25] <antares_> ah
[17:25] <antares_> ok, this may be the case
[17:26] <andreys1> it doesn't actually die fully, it keeps some data by extensions in memory
[17:26] <andreys1> but it is the extensions who makes use of this and keeps something in memory
[17:26] <andreys1> and if you use amqp binding written in PHP, it becomes like part of your script… I don't think there's a way to achieve that
[17:27] <andreys1> but then again maybe it's not that is needed :) and after all PHP's capable of wonderful tricks
[17:27] <andreys1> that are rarely thought of by 99% of simple PHP developers
[17:27] <andreys1> but let us not get carried away by PHP on this wonderful rabbit channel!
[17:27] <andreys1> thanks a lot, I'll get back to coding this all
[17:28] <antares_> andreys1: have fun!
[19:06] <WALoeIII> anyone have experience monitoring rabbit with collectd/graphite
[19:06] <WALoeIII> I want to graph queue length
[19:06] <snack_> antares_: I'm getting: undefined method `method_class' for #<AMQ::Protocol::BodyFrame:0xb4565cc>
[19:06] <snack_> but it doesn't seem to kill other channels
[19:07] <antares_> snack_: right
[19:07] <antares_> snack_: ok, I will look into improving it. I wish we had a script to reproduce… instead of waiting for 2 days each time
[19:10] <antares_> snack_: this is very weird, somehow a content body frame ended up being first on the list
[19:10] <antares_> snack_: well, I guess I will just take a look at what the Java driver is doing
[19:11] <snack_> antares_: cool
[19:14] <antares_> snack_: what's the average message size?
[19:29] <snack_> antares_: I'd say under a kilobyte
[19:31] <antares_> ok
[19:45] <snack_> antares_: I'm getting this pretty consistently now
[19:45] <snack_> maybe it's due to some corrupt state of the rabbitmq broker?
[19:46] <antares_> snack_: I don't know, maybe (since rabbitmq normally does not get into this situation) although not likely
[19:46] <antares_> but this is very strange
[19:46] <antares_> snack_: can you try restarting rabbitmq or it is not an option?
[19:46] <snack_> antares_: I was just going to suggest that
[19:46] <snack_> one moment
[20:04] <rackerhacker> perhaps i'm missing something, but what is the benefit of rabbitmq clusters without mirrored queues?
[20:05] <antares_> rackerhacker: they are mirrored since 2.6.0
[20:06] <rackerhacker> antares_: automatically? without declaring it in the queue declaration itself?
[20:06] <antares_> rackerhacker: but there is plenty of cases when even without mirrored queues you can improve availability
[20:06] <antares_> rackerhacker: yes, they are replicated for you, you don't have to set up anything for that
[20:06] <rackerhacker> oh man, i failed at reading ;)
[20:06] <rackerhacker> i assumed that the mirrored queue portion was required in the args section when you declare a queue with the client libraries
[20:07] <antares_> rackerhacker: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2011-August/014783.html
[20:07] <adeel|work> hi, i'm new to rabbitmq, and i've run into an issue where i'm having trouble finding documentation on. i'm trying to migrate a rabbitmq install from 1 box, to another (which has a different hostname & ip)...when i try to start rabbitmq on the new box, i get this error http://pastebin.com/sRs5Fk9X
[20:07] <antares_> rackerhacker: I haven't used it yet so maybe you are right but the feature is available
[20:07] <antares_> rackerhacker: and it probably uses queue.declare arguments so every client that supports it (nearly every client out there) can use it without any additional features or releases
[20:17] <rackerhacker> antares_: thanks!
[20:18] <rackerhacker> i'll check it out and report back in the next day or two

These logs were automatically created by MyxoRoboto on irc.freenode.net using the Java IRC LogBot.