Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Apigee java callout

Dear @dchiesa1 @anilsr @ssvaidyanathan 

I am currently working on an Apigee integration project where I need to utilize a third-party SDK JAR. To achieve this, I am using a Java Callout and have created a Maven project in which I added the third-party SDK JAR as a dependency. I have written the Java code to invoke methods from the SDK and successfully compiled the Maven project. I then uploaded the compiled JAR to Apigee.

However, during deployment, I encountered the error: "Revision is deployed, but traffic cannot flow."

I am unsure why this error is occurring. My key question is: Is it allowed to use a third-party SDK JAR in an Apigee Maven project for Java Callouts?

0 1 45
1 REPLY 1

Yes, it sure is possible. Apigee cannot distinguish between a "3rd party jar" and the code you write. It's all just code loaded into the Java callout.

BUT, there are restrictions on the things Java code can do in a Callout.  

  • cannot read or write filesystem files
  • cannot read or write System proerties
  • cannot perform reflection
  • and a bunch of other things !

But, unfortunately

  1. I don't think the set of restrictions is all documented. 
  2. The error you see in the UI does not tell you just what is failing

Not a good experience.  

I suggest that you use the API to query the deployment status of your proxy - you may get additional diagnostic information that way. If that does not work, I suggest you contact Apigee support for help in diagnosing the cause of the deployment failure. 

And, a way to avoid these restrictions is to deploy your custom code in an external service, and call it via the ExternalCallout policy.

Good luck

 

Top Solution Authors