1

I am developing a web application which uses REST services. The requirement is that

  1. REST service has to be exposed to public
  2. Consumed by web application

The web application & REST service are two different war files. But will be deployed in same application server.

Since the REST service is deployed in the same server, instead of using http://localhost/services/rest URI, can I use some different approach for better performance? I meant, instead of using HTTP is it possible to use TCP or some other methodology so that performance will be good, because both applications are deployed in same server.

jaks
  • 4,407
  • 9
  • 53
  • 68

1 Answers1

1

If you use typical REST approach (like Resteasy, which is JAX-RS implementation) you are bound to use HTTP - it is by design, all that GET/POST, content type stuff is connected with HTTP communication handling.

If these two applications has to interact, then you can consider usage of Java Messaging Service (JMS) or Hessian or plain Java Sockets for inter-application communication and relay on Resteasy for exposing external API.

Piotr Kochański
  • 21,862
  • 7
  • 70
  • 77