Working With JAVA Callout in apigee?

不想你离开。 提交于 2019-12-25 02:50:13

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/22912998/working-with-java-callout-in-apigee

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!