Bringing an application from Mule 3 to Mule 4 means translating it into a model with fewer special cases. Four changes shape the work. They concern the message model, the expression language, the connectors, and the execution. On top of that comes DataWeave 2 with its adjusted syntax. The following sections put into context what this means for existing applications and which tool the vendor provides for the migration.
In Mule 4, a message consists of a payload and attributes. The inbound properties from Mule 3 are absorbed into typed attributes, and custom values are held in variables. DataWeave replaces the Mule Expression Language (MEL) as the expression language, so data is read and routed without conversion into Java objects. Uniform connectors take the place of the transports. They are included per application and updated independently of the runtime. Error handling works with error types and the Try scope. Execution is handled by a non-blocking engine that adapts its threads to the environment on its own.
According to MuleSoft, DataWeave 2 is largely unchanged compared with DataWeave 1, and the syntax has been simplified. In the header of a script, the directives no longer carry the percent sign. %output becomes output, %var becomes var, and %function becomes fun. Conditions are written with if and else in place of when and otherwise, and types are written without a leading colon, so String replaces :string. New features include modules with imports, typed functions, and calls to Java code. Scripts from Mule 3 are therefore reworked and then tested.
The Mule Migration Assistant (MMA) is an open source project from MuleSoft on GitHub. It converts the project structure, generates descriptors such as pom.xml and mule-artifact.json, makes many adjustments to the code, and provides guidance on the parts that cannot be converted automatically. Complex MEL expressions and DataWeave transformations are migrated by hand, and every application is tested. We use the MMA as a starting point and decide per application whether migrating with the tool or by hand is the better path.
The migration proceeds application by application, with a phase in which the old and the new version run side by side. We are familiar with changes during live operation from our own projects. At an energy utility, the MuleSoft layer orchestrates more than 170 operational processes and keeps the external interfaces stable while the core system migrates from SAP IS-U to S/4HANA Utilities. The page Development & Connectors describes how we develop on Mule 4.