Communication between Python and Jython (JAVA) applications on top of nework

I am going to develop a Saas-based application (software as a service) that uses a python application that will run on the server and a client GUI that will run as a jython application. My initial plan is that the client will be developed in Jython for prototyping purposes, but later, if the complexity of the application increases and depending on the performance degradation of jython, I completely migrate the client to JAVA.

Now I wanted to learn a way to have efficient TCP / IP communication between the server and client applications using some well-known tools such as Twisted. I also thought about other options like corba and pyro.

Therefore, based on this, I have these questions.

What would be the most efficient way to communicate TCP / IP sockets between a python client and jython. Can I use api twisted at the end of python and java socket at the end of jython (they are compatible)? Or is there another better way (for prototyping and assigning RAD)?

+4
source share
2 answers

I recommend using RPC instead of pure TCP / IP communication over sockets.

If you have few customers and don’t want to deal with complex technologies, use something like JsonRPC or XMLRPC. (Note that Pyro can only be used when the server and client are written in Python. If you plan to switch to Java later, you should consider this.)

If performance and security are important (for example, many clients send requests at the same time or you need an SSL connection) use something like Ice . I prefer Ice over Korba because it is simpler, more modern, and yet as good as Korba (maybe even better).

Update . After I read your comments, I really recommend you use Ice. Ice and Corba, as well as technologies like them, are called ORB (Object Request Broker). They do not use the traditional server / client model. Thus, all objects in the application can interact with each other. No matter where they are. In this case, you will have a real distributed application.

+2
source

You can use twisted, nothing wrong with that, I would recommend zeromq . It is very fast and makes recording network applications very simple.

0
source

All Articles