-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Sean,

On 12/23/14 9:48 PM, Sean Dawson wrote:
> On Tue, Dec 23, 2014 at 7:57 PM, Christopher Schultz < 
> ch...@christopherschultz.net> wrote:
> 
>> So the web server (serving the HTML) is on one machine and the 
>> application server (responding to the REST requests the GWT
>> client initiates) are on different machines? So the problem is
>> with Javascript not being able to make a connection to a server
>> that wasn't the source of the page?
>> 
>> 
> Tomcat is on one machine hosting the gwt app (delivering javascript
> to the client, and on the server side accessing a database, etc).
> There's another host/server running a jetty process that receives
> REST calls and does data processing, returns results, etc.  We need
> the client side gwt app to be able to reach the other server as
> well.  Perhaps there's a better way to set this up.

Yes: put an Apache httpd reverse-proxy in front of both servers, and
map the URLs accordingly. Do not use Tomcat/Jetty for proxying when
there is a much better and well-tested solution available.

>> If it's mission-critical, then it's worth spending time on it,
>> right? ;)
> 
> I'm not sure if our stuff would qualify but in general, I agree.
> :)
> 
>>> Can you operate without this proxy, just to see if the GWT
>>> client
>>>> and GWT server can talk to each other without a problem, even
>>>> in newer versions of Tomcat?
>> 
> 
> Hmmm, I suppose I could - I haven't explored what's the latest in
> this area yet.  The thing is....
> 
> 
>> I'd love to get some more information about exactly what the
>> proxy is doing and why. It's possible that you can get rid of it
>> entirely, or replace it with something that is not home-grown.
> 
> 
> In some circumstances, we have to do some load balancing -
> potentially there's one tomcat/app-server and many jetty REST
> servers - and handling this is not trivial. We had a group of
> people who (I think) knew what they were doing evaluate if an
> off-the-shelf product would work for this and they concluded it
> would be best to go with a home-grown solution.

Apache httpd can do this for you: separately load-balanced Tomcat- and
Jetty-based services. You can have a cluster of 50 Jetty instances and
a cluster of 4 Tomcat instances or whatever, and all the configuration
can be done at the httpd level (assuming you are using sticky
sessions... "true" clustering with distributable sessions requires
configuration at the application-server level as well).

I would 100% recommend that you use a single (or group of) proxies
here. You can use any software you want for this purpose like httpd,
nginx, squid, Microsoft IIS, etc. I personally have experience with
httpd which has lots of great options for this stuff. I'm sure the
other products I mentioned will be just as capable so pick whichever
your NOC prefers.

But rolling your own Java-based proxying code is definitely a Bad Idea.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJUntbVAAoJEBzwKT+lPKRY3O0P/0rikX2+u/UqsphS0Nmvq0X9
8TB90TXDUmKvhW1lPidA7rCiZ1mJ5oIzFV7tGGfx1DktGkPIQJFeI9Gyzun6hyt/
HhbrEgOuOc2KiejxrMD4ZZhXU0hjTEhxm7UnodBqnlCSWoijv1a2pA/6MBX/88QR
0rFXQQhuVRN1jP1EPwUIVQ2SeGJcIyhetWWhgOoxaWsmiQY1pP4bnVIwyBpALIm+
YgDgEZmxFdotSF9xfOnkuUCAHm0N17cUUARhBp39H5fpK1ZmHsytxVAbxvN6SSme
W7/AnQN256TeLe7qFUFhP3oynn9GvVFpzZNz3o7hhlc924tqFxLpB0pqKKJb4qmW
bFl8AkrhfFXE6RW+T7sllngV8pHiIvHpTeUMq0xysQc0J6pInJXzMtA0rOAV4F1n
Y4pkoEsyceqkgGimSoArGRBxMYfmPGRy7xWGC97rb1B/Wa65M8qS+qcWWyGlLD4n
5JvotRU2cTw3Vb8bkwTN4TrJuktZA9kOx7MkAE1MQMaPvktF0vIuqRI4b1YLJDwJ
UvkXhDCEbAKH8RgzvN5jk5BiodORMo/yyPb5cv1cXduiFyh286qAbTl9SBdhI6BN
76vBkjO5perOAdBqXlQZCpJE8U2nkTzdIMqf5Suo+9GThEBtBN54JAj/9rL05+Hw
cTX+/Sci1QIN4fM0mXDW
=RPF1
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to