elephant v0.1.0 Elephant View Source
Elephant: A STOMP client.
Example:
{:ok, conn} = Elephant.connect({127,0,0,1}, 61613, "admin", "admin")
callback = fn
%Elephant.Message{command: :message, headers: headers, body: body} ->
Logger.info(["Received MESSAGE", "\nheaders: ", inspect(headers), "\nbody: ", inspect(body)])
%Elephant.Message{command: :error, headers: headers, body: body} ->
Logger.error(["Received ERROR", "\nheaders: ", inspect(headers), "\nbody: ", inspect(body)])
%Elephant.Message{command: cmd, headers: headers, body: body} ->
Logger.error([
"Received unknown command: ", cmd,
"\nheaders: ",
inspect(headers),
"\nbody: ",
inspect(body)
])
end
Elephant.subscribe(conn, "foo.bar", callback)
Link to this section Summary
Link to this section Functions
Connect to server, returns socket.
Subscribe to a topic or queue.