Client: How to subscribe to multiple juggernaut serves?

11 views
Skip to first unread message

stony999

unread,
Nov 17, 2009, 6:49:12 AM11/17/09
to Juggernaut for Rails
Hello,
in a high availability cluster environment (active/active) I want the
juggernaut client in the web browser to subscribe to 2 juggernaut
servers on the 2 cluster machines at the same time, as both servers
will have to send messages to the client.

I would need your advice how to start this in order to not going the
wrong way.
I have installed juggernaut as a plugin into the project so I can
easily modify the source code.

Here's the way I would like to start, please add your comments if
that't the right way and how I should modify it:
- In the Rails view I would like to add 2 links for 2 different
servers, e.g.
<%= juggernaut :debug=>false, :server=>1, :channels =>
['extensions'] %>
<%= juggernaut :debug=>false, :server=>2, :channels =>
['extensions'] %>
- juggernaut_hosts.yml will be enhanced by an additional host
- Then I would like to modify /vendor/plugins/juggernaut/lib/ls
juggernaut_helper.rb in a way, that dependent on the parameter :server
it gives back the right config data for this server.
- this should result in 2 juggernaut entries on the web page.
- I expect to have 2 instances of a juggernaut client on the web page
who will independently connect to the 2 servers
- I am not sure whether I will have to have 2 different SWFs on the
page or if the SWF will accept messages from both servers? If 2 SWFs
are needed I will make another copy of the juggernaut.swf and return
this in the juggernaut helper.

Is this the right way?
Please advice then I will test it right the way.

Best regards
Peter

stony999

unread,
Nov 18, 2009, 4:16:55 PM11/18/09
to Juggernaut for Rails
I tried this, but it didn't work completely:
I added 2 lines for the juggernaut helper to my view:
<%= juggernaut :debug=>false, :channels =>
['extensions'], :server=>0 %> <!-- 1st server is 0 -->
<%= juggernaut :debug=>false, :channels =>
['extensions'], :server=>1 %> <!-- 2nd server is 1 -->
I modified /vendor/plugins/juggernaut/lib/juggernaut_helper.rb
so that I can select a distinct host for each server I define in my
view.
I also made 2 copies of the swf files.
The resulting javascript and html looks promising (the rights swfs are
there, host and port also), however only the last server in the view
(here :server=>1) is connected to. The first one is simply ignored.
Grepping the traffic with ngrep I could not see any packets running to
the firstly defined server.

Any hints how to further proceed are welcome.

Best regards
Peter


Reply all
Reply to author
Forward
0 new messages