Can we make proxy of java RMI code in Apigee

Not applicable

Hello,

I have a legacy code which is written in Java and has java Remote method invocations which are made by client

for demonstrating this i have created a sample code with setup steps you can find it at location ::

Apigee RMI-Server and Apigee RMI Client

I want to know if apigee can support the RMI in java or not.

Solved Solved
0 8 833
1 ACCEPTED SOLUTION

Not applicable

Hi @Anand Jayant Kadhi,

Well, you can't configure RMI from the UI. If you want to make an RMI call then it would have to be done from inside of a java-callout policy. This also means that the use case for this should be an RMI call to some other surface based on the execution of an http request. Now, that request doesn't need to be REST:ful necessarily.

To test this simply you could just configure an api proxy as a no-target (simply a proxy that doesn't talk to a backend service). Then in the preflow add a javacallout policy that references a class. This class needs to implement Execution (like the java callout examples) but can also do any RMI logic you like as well. Now, if this is a long running RMI-stream then this isn't ideal, obviously, inside of apigee, but this is how I think it would work.

Is that clearer?

Thanks,

/geir

View solution in original post

8 REPLIES 8

Not applicable

I don't see why you couldn't do this from inside a java callout policy. However, it's probably only really relevant in a private cloud scenario.

If you're aiming to have this call run as a java policy in apigee's cloud and make an RMI call to something on premise, then I think you can get it to work, but probably would be better to have that exposed locally via some other mechanism. RMI, if memory serves, sometimes likes to make a connection and then agree to connect on different ports for the stream. Doing this from our cloud might not work in that type of scenario, but installed in your own network should be fine.

Hi @Geir Sjurseth

Thanks for your valuable input so you mean to say i can do this RMI call from on-premise dedicated Instance of Apigee. Sorry i didn't get the java callout policy as you mentioned, as the jar would be having java code and there is no Rest call implemented in my code. The example given for Java callout policy in docs still point to the Yahoo Rest url. In my case there is no Rest implemented in code.

And can you please tell how can i configure rmi call through Apigee Edge Management UI like we create the Api proxy calls for Rest Url's. It would be nice if you can mention an example regarding this.

Hi @Geir Sjurseth,

As you mentioned i have to use the java-callout policy as it is not available under free version but for experimental purpose i want to try out the solution you suggested, will it be possible to tweak some logic of the existing sample java-cookbook code from github and experiment to understand before i go for premium.

Please let me know,

Not applicable

Hi @Anand Jayant Kadhi,

Well, you can't configure RMI from the UI. If you want to make an RMI call then it would have to be done from inside of a java-callout policy. This also means that the use case for this should be an RMI call to some other surface based on the execution of an http request. Now, that request doesn't need to be REST:ful necessarily.

To test this simply you could just configure an api proxy as a no-target (simply a proxy that doesn't talk to a backend service). Then in the preflow add a javacallout policy that references a class. This class needs to implement Execution (like the java callout examples) but can also do any RMI logic you like as well. Now, if this is a long running RMI-stream then this isn't ideal, obviously, inside of apigee, but this is how I think it would work.

Is that clearer?

Thanks,

/geir

Hi @Geir Sjurseth

Thanks for putting your valuable time to respond to my query,

Based on what i understood to accomplish the RMI call listing down the things ::

1 > Client will initiate a Http request from web browser or device.

2 > The request will hit the Apigee-Api proxy which will inturn make a Java-callout to my jar.

3 > The java class will call the RMI server and get the response.

4 > As there is no backed service in picture the Response will be returned directly to the client via the java class.

Is my understanding correct or i missing something,please let me know.

Not applicable

I would also watch out for the Security Manager Restrictions. The Apigee VM might not allow the security polices that are needed for RMI activities like code downloads.

Can you please elaborate your usecase on why RMI.

Hi @sriki77

Actually i have some legacy code which runs on RMI calls, and i won't be able convert them into REST calls so was asking this.

Not applicable

Yes, absolutely... You just need to change what that sample does. Honestly, you should be able to take most of your sample client code and just plug it in.

/geir