Working With JAVA Callout in apigee?

2019-09-01 08:52发布

can any one explain java callout a little help will do.Actually i am having several doubts regarding where to add the expressions and message flow jar and where to add my custom jar. Can i access the resources/java folder directly and can i use it to store my data?

标签: apigee
1条回答
Lonely孤独者°
2楼-- · 2019-09-01 09:51

First, check the docs on apigee at

Customize an API using Java
http://apigee.com/docs/api-services/content/customize-api-using-java

Keep in mind Java Callouts are only supported in the paid, Apigee Edge product, not the free Developer platform.

As you decide how to use Java, you should consider this basic hierarchy of policy management:

  • Policy Configuration First: Apigee policy configurations are in broad use and therefore tested daily by clients and most performant.
  • Javascript Callout: For stuff you can't do in a standard policy there is Javascript -- keep in mind this is "Compiled Javascript" which means at the time you deploy your project the JS gets interpreted by the Java Rhino engine and then runs like native code. Very fast, very scalable, and very easy to manage as your code is all in plain text files.
  • Java: You have to have a pretty compelling reason to use Java. Most common cases are where you have some complex connection that needs to be negotiated with custom encryption schemas or manipulating binary content. While perfomant, it's the most difficult code to manage (you upload compiled jars, so if someone takes over your work, the source code is in a separate place than your deployment bundle), and it's the most difficult to debug in the event of a failure.

To your specific question: All Apigee variables are available in Java and Java gives you pretty much god-like powers on the local server where the code is executed. Keep in mind, Apigee's physical architecture is distributed -- your jar may run on different servers for different API calls, so any persistent data (that you might want to store locally) should really be put into Key Value Map and read as needed. Keep your API development as stateless as possible.

Hope that helps.

查看更多
登录 后发表回答