I am not totally seeing how I can use this to solve my problem. I am currently sending all my messages to a direct exchange with the same routing key. (Maybe a mistake). Suppose I had each "group" of messages have a different routing key. I can't get all the messages going to that exchange on a single queue, right? And once a message is routed to a queue, changing the binding wont re-route the messages, right?
What I want: Producer: A1, B1, C1, D1, A2, B2, A3.... Consumer: A1 (asks for a few more As) A2, A3, A4 B1 (asks for a few more Bs) etc. etc. I can't create queues for each group because there are going to be way too many (but the active set should be small). Adam On Thu, Jan 22, 2009 at 8:14 PM, Carl Trieloff <[email protected]> wrote: > Andrew Wright wrote: >> >> Hi all, >> >> I've been watching this thread with interest (partially in the hope of an >> example as well!) An example of atomic update of direct bindings does sound >> very interesting. Is it possible to get at this from Java? (Pure JMS not a >> requirement). > > Andrew, > > yes, when you do the queue declare you mark the binding as exclusive. Then > additional bindings matching are atomically replaced. This can be done from > any client against the C++ broker > > FieldTable args; > args.setInt("qpid.exclusive-binding",1); > > //the following will cause the only binding from amq.direct with 'my-key' > //to be the one to 'my-queue'; if there were any previous bindings for > that > //key they will be removed. This is atomic w.r.t message routing through > the > //exchange. > session.exchangeBind(arg::exchange="amq.direct", arg::queue="my-queue", > arg::bindingKey="my-key", arg::arguments=args); > > > > This is taken from > http://cwiki.apache.org/confluence/display/qpid/Cheat+Sheet+for+configuring+Exchange+Options > > regards, > Carl. > > --------------------------------------------------------------------- > Apache Qpid - AMQP Messaging Implementation > Project: http://qpid.apache.org > Use/Interact: mailto:[email protected] > > --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:[email protected]
