Stuart Longland
unread,Apr 15, 2015, 6:14:00 PM4/15/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rabbitm...@googlegroups.com
Hi all,
Silly question. I'm trying to figure out a state machine framework for
interacting with AMQP so that I can develop a set-and-forget AMQP client.
The concept is that the application creates whatever queue and exchange
objects, binds them, sets them up to consume, pushes messages to them, etc.
The mechanics of opening channels, declaring objects, then binding and
consuming queues is looked after by state machines. Fire and forget.
If there's a problem, we get notified by a callback mechanism.
For simple cases, this isn't too hard. Direct exchanges, fan-out and
topic exchanges are no problem here. I have a simple scheme wherein the
topics for an exchange are stored in 3 sets: one storing my currently
bound topics, one for topics that are to be bound and one for topics
that are to be unbound.
On receipt of a 'declare-ok', 'bind-ok' or 'unbind-ok', I can look
through my to-bind or to-unbind sets, pick one off the list, and action
it: making a note of what we were just doing. When the reply comes
back, I update my state and proceed until the to-unbind and to-bind sets
are empty.
Then we get header exchanges.
One option is I make these sets dicts/maps/hashes/tables (whatever the
language calls them); mapping the routing key to the arguments.
Question is, is it valid to have multiple bindings of a queue to the
same header exchange with different arguments?
If the queue is already bound to the exchange with a given routing key,
does the 'bind' operation add/overwrite to the arguments previously
given, does it completely replace the old arguments, or would that throw
back an error because we're already bound to that exchange? (Or be
ignored?).
I realise the routing key is not used for making routing decisions, is
that key used for maintaining separate argument tables or is it
completely ignored by the broker?
Regards,
--
Stuart Longland (aka Redhatter, VK4MSL)
I haven't lost my mind...
...it's backed up on a tape somewhere.