I currently using rabbit_client
to send queue message from our ejabberd. This message is triggered using ejabberd hook. Can successfully compiled and installed without any issue.
I keep on getting the same error when the try to create the connection. Appreciated if someone could give some clue on the issue.
Following is the code used to connect and publish the message.
{ok, Connection} =
amqp_connection:start(#amqp_params_network{host = "192.168.xx.xx", username = "username", password= "password"}),
{ok, Channel} = amqp_connection:open_channel(Connection),
amqp_channel:call(Channel, #'queue.declare'{queue = <<"hello">>}),
amqp_channel:cast(Channel,
#'basic.publish'{
exchange = <<"">>,
routing_key = <<"hello">>},
#amqp_msg{payload = <<"Hello World!">>}),
io:format(" [x] Sent 'Hello World!'~n"),
ok = amqp_channel:close(Channel),
ok = amqp_connection:close(Connection),
ok.
Error
{undef,[{amqp_connection,start,[{amqp_params_network,"username","password",<<"/">>,"192.168.xx.xx",undefined,0,0,10,infinity,none,[#Fun,#Fun],[],[]}],[]},{mod_mymod,send_internal_notice,4,[{file,"src/mod_mymod.erl"},{line,67}]},{ejabberd_hooks,safe_apply,3,[{file,"src/ejabberd_hooks.erl"},{line,382}]},{ejabberd_hooks,run1,3,[{file,"src/ejabberd_hooks.erl"},{line,329}]},{ejabberd_c2s,presence_update,3,[{file,"src/ejabberd_c2s.erl"},{line,2068}]},{ejabberd_c2s,session_established2,2,[{file,"src/ejabberd_c2s.erl"},{line,1249}]},{p1_fsm,handle_msg,10,[{file,"src/p1_fsm.erl"},{line,582}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}