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

Harshit,

On 3/1/17 9:22 PM, Daga, Harshit wrote:
> Thanks Christopher for JMX option but it is taking more time.
> 
> Use case : I have two tomcat servers (s1 and s2). I will call a
> method in s1 server from external source. On the method invocation
> s1 contacts s2 and passes on the information (example some
> in-memory data stored for the s1 is passed on to s2).
> 
> If I use JMX, it is takes time to connect to server1 and fetch the 
> information and then connects to server2 and update the
> information.

Why can't server1 contact server2 directly? There's no need for a 3rd
party to be involved.

> What I am looking for is to create light service and expose to
> some port (let say 8100). Now if I call this service on s1 (from
> outside) the s1 should connect the s2 and pass on the information.

Okay, you can still use JMX.

1. Catalyst client contacts server 1
2. Server 1 accepts the request, recognizes a "check server 2" request
3. Server 1 connects to server 2 via JMX (or via JMXProxyServlet,
which is probably more convenient) to call GetListOfSessions
4. Server 2 returns the list of sessions to server 1
5. Server 1 does whatever it needs to do with the session list from s2
6. Server 1 returns an "OK" response to the catalyst client

> Kindly provide me some suggestion on how I can do this.

There is nothing in Tomcat that can specifically help you to do this
other than, for example, the availability of the session information
via JMX. You'll have to write everything else on your own.

If you want both servers to know about each others sessions, why not
cluster the nodes together and have Tomcat share the sessions between
the two servers?

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJYvZxvAAoJEBzwKT+lPKRYKjoP/R3G+HTqzKfL+CXWL3r5yQ7f
fshO6rtLZh+Ea5185XXya+33FYm09PCGfLUQSbSjNH2p2MSWxo4PUBoaqH27yTsY
KGHgO5pD49lGMMGR/NNd3k5ZJp/ij96TR3Oa5/w+Bi7FzmvY41p/lLjTTAQR8m0o
bEtcrlvBS8jQduNLw05/VjacUCtGpaZeODlYW5VNmqK26sLl/PzOmcdYm381XgI6
7xFmViqTx8lgPF7vjIc1H+L9DlAuLSbB24aLLuxqjsa/nehpajcbILB+qX34lA2K
nXX1b38L4Cv3dG1NMDdTUa2IPUUdxYfFootrVTqtefnNCO96D3YXUEHfp/jFL7FL
TZBvlHQp6M0VR1XaGfARkM/ZiftP4NUt9QtqXUza1vRd9QI4bQcVRDxYu3u2KcMG
6Ctfi8ntwz3QsEeaQJ1If8XlGezas+gJRoOnPRngETo75xIRq1F8DLUkE5MN8CbA
cKhzRnxRGwPrCB8NFUbaRF+g97PKZilY3Mq7vqUVGtZwtuLqjAUjBONYp85xTKGN
WvqPMT/PqIXEx36x4zH4j921cg/9JrGKIDPa52YvDbVnwKje/6KJeWGjwwOazb9n
qSQAZ4yyJmUFiBX2SAfTJQFD/LcTlzwL3FsNYjnMcr6tld5kZMJuSEm+V8svecGX
a/xYZTFRQ7W1UsL0IGKI
=RqBW
-----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