Tony,<br><br>Thanks! That's a bit more elegant than what I did, which was to change the startup erl command and add '-s inets' there. Thanks!<br><br>BTW, I updated it a little to make the URL to hit customizable and based it on a version that worked with 1.5.4 (the rabbit-version we plan to use in production). I have it so the URL is put as an arg along with hostname and port for the STOMP adapter; so the startup script had to be changed to:<br>
<br>stomp_listeners [{"0.0.0.0",61613,"<a href="http://nemik.net/test/test.php" target="_blank">http://nemik.net/test/test.php</a>"}] or whatever URL a user might need.<br><br>Thanks again,<br>Nemanja<br>
<br><div class="gmail_quote">
On Thu, Apr 30, 2009 at 12:35 PM, Tony Garnock-Jones <span dir="ltr"><<a href="mailto:tonyg@lshift.net" target="_blank">tonyg@lshift.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Nemanja,<br>
<br>
Interesting stuff!<br>
<br>
Re the inets:start() automation issue: set "extra_startup_steps",<br>
already used to start the STOMP plugin, to include a call to inets too:<br>
<br>
... extra_startup_steps<br>
[{"STOMP-listeners",rabbit_stomp,kickstart,[]},<br>
{"inets",inets,start,[]}] ...<br>
<br>
You will probably need to use backslash-escaping to make it look like<br>
the "STOMP-listeners" setting you already have, and make sure there's no<br>
whitespace anywhere in there. The shell gets mighty confused about<br>
whitespace.<br>
<br>
Regards,<br>
Tony<br>
<div><div></div><div><br>
<br>
Nemanja Stefanovic wrote:<br>
> Hello,<br>
><br>
> I just wanted to contribute some code I recently changes if anyone needs<br>
> it. We have a use-case where I'm using STOMP with RabbitMQ's STOMP<br>
> adapter and Orbited to push updates to a browser, or maybe even allow<br>
> clients to connect to the STOMP server, not sure yet. Anyway, we need to<br>
> ensure that only certain users get pushed certain content, hence<br>
> authentication.<br>
><br>
> The way I have this working is: client connects to STOMP with generic<br>
> just-TLD cookie (so it can be passed also to STOMP server which would<br>
> run on another subdomain) and Orbited's io.js can read the cookie and<br>
> send it up to the STOMP adapter as a 'cookie' header. It (the JS) also<br>
> generates a random ID for the queue-name for that connection. This is<br>
> all assuming I have 1 queue per connection as per the broadcast-style<br>
> suggestion for STOMP adapter.<br>
><br>
> So now the STOMP adapter reads that cookie header and hits a page using<br>
> http:request (via inets) with that cookie and passes in the queue name<br>
> too. The web-app will recognize the cookie as belonging to a user and<br>
> read the queue name. It (the web-app) will then set the appropriate<br>
> bindings for that user. Since this is a topic exchange, the bindings<br>
> would be for the topics updates the user will receive on her browser. If<br>
> there is no cookie or the cookie is invalid, the web-app can take care<br>
> of all that and just assign some default bindings for guests.<br>
><br>
> This is all working pretty well, except that I have to start<br>
> 'inets:start()' manually in the erl command prompt. I was wondering how<br>
> could I get this to be done on startup when the STOMP adapter starts?<br>
><br>
> I've attached the code and a diff (based on the tip of STOMP adapter<br>
> from hg). Right now the URL is hardcoded but I plan to make that more<br>
> configurable later.<br>
><br>
> Anyway, I hope maybe it can be of some use to someone who might need<br>
> similar functionality.<br>
><br>
> -Nemanja<br>
><br>
><br>
</div></div>> ------------------------------------------------------------------------<br>
><br>
> _______________________________________________<br>
> rabbitmq-discuss mailing list<br>
> <a href="mailto:rabbitmq-discuss@lists.rabbitmq.com" target="_blank">rabbitmq-discuss@lists.rabbitmq.com</a><br>
> <a href="http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
<font color="#888888"><br>
<br>
--<br>
[][][] Tony Garnock-Jones | Mob: +44 (0)7905 974 211<br>
[][] LShift Ltd | Tel: +44 (0)20 7729 7060<br>
[] [] <a href="http://www.lshift.net/" target="_blank">http://www.lshift.net/</a> | Email: <a href="mailto:tonyg@lshift.net" target="_blank">tonyg@lshift.net</a><br>
</font></blockquote></div><br>