[Q] moqueue and direct exchanges

14 views
Skip to first unread message

Chuck Remes

unread,
Sep 8, 2009, 2:17:05 PM9/8/09
to ruby...@googlegroups.com
I've been messing around with the moqueue gem today. It's pretty cool.
I did notice something missing and I'm wondering if its omission is
intentional or I am misunderstanding the AMQP spec.

Both topic and fanout exchanges can be redeclared and return the same
mock. It does not appear to be true for direct exchanges.

I ran the specs and noted from the specdoc that direct exchanges
aren't mentioned for MockBroker or MockExchange. I've edited the
specdoc output and included it below to highlight what I mean.

Moqueue::MockBroker
- should keep a list of named queues
- should reset itself
- should keep a list of topic exchanges
- should keep a list of fanout queues

Moqueue::MockExchange
- should emulate topic exchanges
- should register new topic exchanges with the mock broker
** - should return a previously created topic exchange when asked to
create a new one with the same topic
- should register new fanout exchanges with the MockBroker
** - should return the exact same fanout exchange if creating one with
an identical name

Should I fork the repository and add this functionality for direct
exchanges or would I be wrong to do so?

cr

Daniel DeLeo

unread,
Sep 8, 2009, 2:45:56 PM9/8/09
to ruby...@googlegroups.com
Chuck,
My intention for moqueue is for the behavior to be as much like the real AMQP behavior as possible. Any discrepancy is due to laziness ;). Fork away, and send me a pull-req when you're done. 

Thanks, and good catch,
Dan DeLeo

Chuck Remes

unread,
Sep 8, 2009, 4:02:52 PM9/8/09
to ruby...@googlegroups.com
Cool. Forked it, coded it up, all new tests pass.

Sent you a pull request too.

BTW, two specs in the ack_spec.rb were failing. I confirmed they were failing before I forked it though.

cr

Daniel DeLeo

unread,
Sep 9, 2009, 1:06:33 AM9/9/09
to ruby...@googlegroups.com
Chuck,
Specs all pass for me. Are you on 1.8.6 by chance? I've been known to use 1.8.7-only methods especially on Enumerables without thinking about it. If you'd like to email me directly with the stack trace, I can take a better look at it.

Anyway, your patch is in, thanks!

Dan DeLeo
Reply all
Reply to author
Forward
0 new messages