Skip to content

stomp.erl is a simple client library for message brokers that support the STOMP protocol.

Notifications You must be signed in to change notification settings

Soulforged/elixir-stomp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#A Stomp client written in Erlang and wrapped in Elixir

####Check the Wiki for more info or go straight to the the API docs.

##Usage sample:

%Create a message handling function:

Fun = fun(Msg) ->
io:format("Message ~p~n",[Msg])
end,

%Start the client and keep it's Pid:

{ok,Pid} = stomp_client:start("localhost",61613,"","",Fun),

%subscribe to a topic or a queue:

stomp_client:subscribe_topic("TestTopic",[],Pid).

%send a message to the TestTopic:

stomp_client:send_topic("TestTopic","This is a test message",[],Pid).

You should now get a printout on the console every time a message arrives on the topic you've subscribed to.

##Update for issue #1 You could now start the client using start/6 which takes anything as an internal state. If you do that you need to change your onmessage function to arity/2 since it will now need to handle the message and the state as input. I also added a get_client_state function to query the internal state (note, that this is a blocking call).

About

stomp.erl is a simple client library for message brokers that support the STOMP protocol.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Erlang 100.0%