Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessing a Java RMI API from Python program

Tags:

java

python

rmi

I have a Python program that needs to access a Java RMI API from a third party system in order to fetch some data.

I have no control over the third party system so it MUST be done using RMI.

What should be my approach here? I have never worked with RMI using Python so I'm kind of lost as to what I should do..

Thanks in advance!

like image 471
pteixeira Avatar asked Oct 05 '22 07:10

pteixeira


2 Answers

How about a little java middle ware piece that you can talk to via REST and the piece in turn can to the remote API?

like image 167
vector Avatar answered Oct 07 '22 20:10

vector


You're going to have a very hard time i would imagine. RMI and Java serialization are very Java specific. I don't know if anyone has already attempted to implement this in python (i'm sure google knows), but your best bet would be to find an existing library.

That aside, i would look at finding a way to do the RMI in some client side java shim (maybe some sort of python<->java bridge library?). Or, maybe you could run your python in Jython and leverage the underlying jvm to handle the RMI stuff.

like image 44
jtahlborn Avatar answered Oct 07 '22 20:10

jtahlborn