Contact Free trial Login

Java Module - Mule 4

Mule 4 is built to:

  • Minimize the need for custom code.

  • Avoid the need for you to know or understand Java.

However, some advanced uses cases require integration with custom Java code, such as:

  • Reuse of a library, such as a tax calculation library.

  • Reuse of a canonical object model that is standard in the organization.

  • Execution of custom logic using Java.

In Mule 3, MEL served as a bridge for creating instances of Java classes and executing Java methods. In Mule 4, interoperation with Java changed, due to the replacement of MEL by DataWeave, which is a functional language. Functional languages do not have side effects on their input arguments, so it does not make sense for DataWeave to execute random instance methods on random object instances. Therefore, pure DataWeave supports calling only static Java methods, without use of the Java module.

Java Module Versus the Scripting Module

You can use the Java module, or execute Groovy code through the Scripting module. However, the Scripting module does not offer DataSense support, user interface support, visual aids for methods available for each class, autocompletion, and so on. See Java Integration.

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.