Re-usable Java functions

guycrets
Participant IV

Apigee docs recommend use of Java as language of choice if performance is most relevant.

Does anyone maintain set of useful Java functions for use in Apigee? Willing to share this?

  • Numeric functions
  • String functions
  • Data and time handling
  • Hash calculations
  • Rewrite (URI's in) payload
  • Non-blocking POST
  • ...

KR, Guy Crets

Solved Solved
0 1 102
1 ACCEPTED SOLUTION

<p>I think JS is the best approach for many tasks (URI rewriting or reformatting, date handling, etc) because it's so easy to use. Java has a bit more overhead in the development tasks.</p><p>Java is important when you're doing things like Public/private key crypto. Or HMAC in an iterative fashion (like 10,000 HMACs as you might do with PBKDF2). For other cases, I would suggest JS.</p><p>Also see the static functions builtin to the Message Template (https://docs.apigee.com/api-platform/reference/message-template-intro) . These include base64 encoding and decoding, XML Encoding, jsonpath... and others.</p>

View solution in original post

1 REPLY 1

<p>I think JS is the best approach for many tasks (URI rewriting or reformatting, date handling, etc) because it's so easy to use. Java has a bit more overhead in the development tasks.</p><p>Java is important when you're doing things like Public/private key crypto. Or HMAC in an iterative fashion (like 10,000 HMACs as you might do with PBKDF2). For other cases, I would suggest JS.</p><p>Also see the static functions builtin to the Message Template (https://docs.apigee.com/api-platform/reference/message-template-intro) . These include base64 encoding and decoding, XML Encoding, jsonpath... and others.</p>