What is the client-server approach to work?

Basically, I need bidirectional client-server communication (Java), where the client calls methods on the server, but I also need to get "callbacks" if certain events occur on the server. The methods themselves have quite complex input and output parameters, and in the future it would be nice to include authentication in the system. Which approach fits my requirements? I am already creating a prototype with RMI, but I read that there are a number of problems, especially for "callbacks" when c / s are on different networks. In addition, I would like to avoid the JAX technology associated with my complex data structures in the parameters.

+5
source share
2 answers

Have you ever thought about using JMS. Within this architecture, the server and client will register in a queue or topic and can send messages to each other. This allows you to use the behavior of sych and asynchronous application.

Please pay attention to JMS here:

http://java.sun.com/developer/technicalArticles/Ecommerce/jms/index.html

And a really good implementation is ActiveMQ:

http://activemq.apache.org/

+1
source

I was fortunate enough to use CometD for callbacks for webapps.

0
source

All Articles