Communicating with Java web application from non-java application over TCP / IP socket

Hosting an application on a web application server eg. JBoss automatically provides a lot of application server functionality with it eg. security, clustering and load balancing, etc. I have a situation where I need to develop a server application with which legacy applications can talk over TCP / IP socket and also be very accessible. Originally though I used JBoss app server to take advantage of its clustering support for HA. However, I am not sure if it is possible to connect to a JBoss web application using pure TCP / IP sockets from java and non-java applications. What is the best way to achieve this without using a web service or Http approach?

UPDATE: I'm especially interested in seeing how legacy apps would connect to a hosted web app over a TCP / IP socket.

+2


source to share


3 answers


Actually a simple solution to bring the two worlds together would be to add a simple Java server that maps old TCP / IP requests to HTTP requests. This is probably a fairly complex task, so this "server" will be easy to write and maintain. Also, this server won't require as much power as it just accepts and forwards connections (no business logic or DB code).

On the JBoss server, you develop as usual. Legacy applications connect to a small bridge server that forwards JBoss requests and returns the result back.



This ensures that you are building for the future: when new applications are developed, they can connect directly to JBoss and use all the great HTTP features.

+1


source


There is no reason why you cannot open a regular socket in a (say) servlet application hosted in JBoss.



Then you can get a stream of bytes. The headache then is to decide on a platform independent presentation of your messages so that your client's end can format and send so that the JBoss-accessible end can read. But all this is quite feasible.

+1


source


I would implement a very simple http (1.0) client.

0


source







All Articles