[rabbitmq-discuss] rabbitmq-stomp adapter tweaks

Rob Harrop rob at rabbitmq.com
Fri Feb 11 13:16:25 GMT 2011

The easiest way to do this is to tweak the reader so that it fires off
the CONNECT frame to the processor once the TCP connection is

This means that changes to the processor internals won't affect your
patch. I got this working with the attached patch.

Hope this helps,


On Wed, 2 Feb 2011 01:48:04 -0800 (PST), SonicSNES <dis1 at sonicsnes.net>
> I've been moving around a bunch of code in rabbitmq-stomp to tailor it
> specifically for my app, and hit one tiny roadblock which is
> preventing me from finishing.
> How would I go about bypassing the login sequence, so the client gets
> a CONNECTED as soon as it connects? I'm trying to call do_login from
> init, but my with limited erlang skills, all I can get it to do is
> hang, time out, or catch on fire. I'd assume it's just a tiny bit of
> code, but I'm stumped.
> -- SS
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
-------------- next part --------------
diff -r 18a5ff568af9 src/rabbit_stomp_reader.erl
--- a/src/rabbit_stomp_reader.erl	Fri Feb 11 12:19:45 2011 +0000
+++ b/src/rabbit_stomp_reader.erl	Fri Feb 11 13:15:50 2011 +0000
@@ -49,6 +49,13 @@
             PeerAddressS = inet_parse:ntoa(PeerAddress),
             error_logger:info_msg("starting STOMP connection ~p from ~s:~p~n",
                                   [self(), PeerAddressS, PeerPort]),
+            %% Send CONNECT frame automatically
+            ConnectFrame = #stomp_frame{command = "CONNECT",
+                                        headers = [{"login", "guest"},
+                                                   {"passcode", "guest"}]},
+            rabbit_stomp_processor:process_frame(ProcessorPid, ConnectFrame),
             ParseState = rabbit_stomp_frame:initial_state(),
                 ?MODULE:mainloop(#reader_state{socket        = Sock,

More information about the rabbitmq-discuss mailing list