Skip to content

Instantly share code, notes, and snippets.

@manpages
Created December 8, 2012 19:06
Show Gist options
  • Save manpages/4241430 to your computer and use it in GitHub Desktop.
Save manpages/4241430 to your computer and use it in GitHub Desktop.
debugging fubbit
PID = fubbit:proxy([{host, "127.0.0.1"}, {port, 56695}], [<<"no">>], self()).
fubbit_connection:mq_run(PID, [{action, <<"queue.declare">>}], [{queue, <<"it_works">>}]).
%% more snippets:
QDec = fbbbit_records:'#new-queue.declare'().
[ {X, fubbit_records:'#get-'(X, QDec)} || X <- fubbit_records:'#info-'('queue.declare', fields)].
%% publish something already!
% fubbit_connection:mq_run(PID, [{action, <<"basic.publish">>}, {payload, <<"amqp_msg">>}], [{routing_key, <<"it_works">>}], [{payload, <<"a special plan">>}]).
fubbit_connection:mq_run(PID,
[{action, <<"basic.publish">>}, {payload, <<"amqp_msg">>}],
[{routing_key, <<"it_works">>}],
[{payload, <<"a special plan">>}]
).
%% a perfect example of consumerism
fubbit_connection:mq_run(PID, [{action, <<"basic.get">>}], [{queue, <<"it_works">>}, {no_ack, true}]).
@manpages
Copy link
Author

manpages commented Dec 8, 2012

F*ck yeah:

2> fubbit_connection:mq_run(PID, [{action, <<"queue.declare">>}], [{queue, <<"it_works">>}]).
running binary_to_existing_atom with
<<"#new-queue.declare_ok">>
ouch
calling the rabbit
he made them laugh, oh yes, he did{'queue.declare_ok',<<"it_works">>,0,0}

@manpages
Copy link
Author

manpages commented Dec 8, 2012

And now the bug with validating output is fixed:

2> fubbit_connection:mq_run(PID, [{action, <<"queue.declare">>}], [{queue, <<"it_works">>}]).
running binary_to_existing_atom with 
<<"#new-queue.declare_ok">>
ouch
calling the rabbit
the children always followed himok

And in rabbitmqctl:

Every 2.0s: sudo rabbitmqctl list_queues                                                                                                                                                                               Sat Dec  8 21:13:32 2012

Listing queues ...
it_works        0
...done.

I'll remove debug output after one more cycle of tests.

@manpages
Copy link
Author

manpages commented Dec 8, 2012

Yay, shit works and tested. I still have to write a nice proxy but so far that thing is usable from Elixir, which is nice.

Every 2.0s: sudo rabbitmqctl list_queues            Sat Dec  8 23:26:07 2012

Listing queues ...
it_works        1
it_works1       0
...done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment