Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java EE and outgoing TCP connections

So I'm facing a challenge to develop a web application which would have to display real time data coming from remote server. To connect to this remote location I'd need TCP sockets and some arbitrary protocol(not HTTP).

My goal is to have the web server connect to the other server, keep the connection alive indefinitely and continuously read data while displaying that data in real time on the website.

Now my question is, how would I go about this using Java EE? I could also develop completely separate software to handle the outgoing TCP connection, but how then would I handle communication between web app and this other software?

like image 987
user1762838 Avatar asked Mar 10 '26 05:03

user1762838


1 Answers

this is a rather broad question and there is several ways to do this.

one way is to have an mdb in the webapp that consumes from a queue that the external server is producing messages to. ive been doing this using glassfish and activemq messagebroker.

then primefaces push to send events from webapp to client browser

like image 184
Aksel Willgert Avatar answered Mar 13 '26 01:03

Aksel Willgert



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!