I'm writing a JAX-RS web service. It responds to client invocations by:
- Retrieving some info from a database
- Making a call to an external server
For 2) the server does not expose a web service interface (i.e. no WSDL interface or REST API). Instead, it uses a custom protocol over TCPIP. I'd like to make client calls from my JAX-RS resource directly to this server but I don't want to have to open a connection, authenticate, and close the connection for each call to my JAX-RS resource. Is there a way around this? In other words, is there something like a "socket connection pool" available to Java EE apps? Would I have to use something like an ESB? Or is there an alternative that I'm overlooking?