Naveen Raj
Naveen Raj

Reputation: 801

Mule ESB : Which has better performance -- scripts (java script,groovy,ognl etc ) or java code through Java component or transformer

I had this question in mind for long time and am jotting it down now.

Which will be a best practice or has an edge over others while transforming or processing data in Mule ESB. I am curious to differentiate between the following components.

  1. Java Script
  2. Groovy Script
  3. Other allowed scripts

VS

Java Component or Java Transformer

Usually any ESB should provide various options for the transformations and Mule also provides a lot of ways and methodologies for transformation.

I am curios to know which is better for some of the common situations.

For example check the scenarios for below.

Calling a java component to chunk out a list from an object and make that list as the payload VS using OGNL in set payload component.

Upvotes: 1

Views: 2033

Answers (1)

Víctor Romero
Víctor Romero

Reputation: 5115

OGNL is being deprecated in Mule.

Regarding Javascript vs Groovy vs MEL (MVEL) I would say it depends.

MEL scripts are the faster to start (find here some performance benchmarks), followed by Javascript (Mule still does not use Java 8's Nashorn) and followed by Groovy.

However, for very big tasks where initialization doens't matter that much groovy might still perform faster.

Anyhow, for almost the 100% of the cases, Java components, on equivalent tasks will perform faster than any other binding. This is due that Mule is written in Java and is doing straight API calls without using bindings or adaptations.

Upvotes: 3

Related Questions