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

Limits of Java Callout in Apigee X

Hi everyone! 👋

I'm trying to better understand the limitations of Java Callout in Apigee, especially when working with external libraries. I know that Apigee X does not natively support JMS, but I attempted to create a custom JAR that connects to an ActiveMQ server within a Java Callout policy.

Even though I included all the required dependencies, the JAR fails to execute, consistently throwing an error when calling a specific ActiveMQ library.

🔍 What did I try?

  • Created a JAR containing Java code that connects to an ActiveMQ server.
  • Included all necessary dependencies, such as activemq-client.
  • Uploaded the JAR and added a Java Callout policy in Apigee.
  • Even with all dependencies seemingly in place, the error persists.

🚨 Error encountered:

{
    "fault": {
        "faultstring": "Failed to execute JavaCallout. org/apache/activemq/command/DestinationInfo",
        "detail": {
            "errorcode": "steps.javacallout.ExecutionError"
        }
    }
}

Or, in some cases:

com.apigee.kernel.exceptions.spi.UncheckedException

My question:

What are the exact limitations of Java Callout development in Apigee?

  • Does Apigee restrict certain classes or libraries?
  • Are there classloading limitations that could prevent external dependencies from being executed?
  • Does Apigee sandbox the execution environment, blocking specific Java operations?

If anyone has encountered similar issues—especially with JMS, ActiveMQ, or other external Java libraries—I’d appreciate any insights or workarounds! 🙌

📌 Additional context that might help:

  • Java Callouts in Apigee must be compiled for Java 8 (or the version supported by Apigee).
  • Some environments may restrict network access or multi-threaded operations.
  • Apigee may block the execution of certain classes for security reasons.

Has anyone successfully implemented JMS inside an Apigee Java Callout? Any suggestions or best practices would be greatly appreciated! 🚀🔥

Thanks in advance for your help!

Solved Solved
0 2 200
1 ACCEPTED SOLUTION

I don't know of anyone who has done JMS from within a Java callout.  I would say there are better options. 

The docs should show what the Java permission restrictions are for a callout. Sorry I don't have the doc link available.

In general if you want to do heavy things like JMS, you should look outside of Apigee. 

  • Host a Java service in cloud run, that uses the JMS libraries, and connect to the Java service from Apigee via ServiceCallout or ExternalCallout.  I did this recently for a Url signing service - it's not JMS but it's similar. In that it does things that are not permitted from within a Java callout. 
  • Connect from Apigee into Application Integration, and use the connector available there to plug into JMS. 

Good luck!

 

View solution in original post

2 REPLIES 2

Hey @marcelobarroso 🙂

We’ve seen that your question hasn’t gotten a response yet. We’ll keep checking in on this thread and encourage other members to share their thoughts.

Thanks for being part of our community!

I don't know of anyone who has done JMS from within a Java callout.  I would say there are better options. 

The docs should show what the Java permission restrictions are for a callout. Sorry I don't have the doc link available.

In general if you want to do heavy things like JMS, you should look outside of Apigee. 

  • Host a Java service in cloud run, that uses the JMS libraries, and connect to the Java service from Apigee via ServiceCallout or ExternalCallout.  I did this recently for a Url signing service - it's not JMS but it's similar. In that it does things that are not permitted from within a Java callout. 
  • Connect from Apigee into Application Integration, and use the connector available there to plug into JMS. 

Good luck!