[rabbitmq-discuss] amqp_rpc_client and lib_amqp

lenz norbu09 at googlemail.com
Fri Oct 3 03:04:10 BST 2008


hi,
i have somehow clumsy fingers. i try to get a test script working that uses
the erlang rpc client and lib_amqp but i fail miserably. is there somewhere
a short snippet that actually uses those two libs to post messages to
rabbit? my (very short) test thingy looks currently like that (many
iterations old though)

---------------------8<------------------

-module(test).

-include_lib("rabbitmq_server/include/rabbit_framing.hrl").
-include_lib("rabbitmq_server/include/rabbit.hrl").
-include("include/amqp_client.hrl").

-export([channel/0, broker/0, start/0]).

channel() ->
    C=lib_amqp:start_connection("localhost"),
    Channel=lib_amqp:start_channel(C),
    {ok, Channel}.

broker ()->
    {ok, Channel} = channel(),
    Broker = #broker_config{channel_pid = Channel},
    {ok, Broker}.

start() ->
    {ok, Broker} = broker(),
    amqp_rpc_client:start(Broker, <<"Hessian">>).

--------------------->8------------------

thanks for all hints in the right direction :-)

cheers
lenz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20081003/1fddc60e/attachment.htm 


More information about the rabbitmq-discuss mailing list