<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>