What changes in Mule 4?

  • Written By Prathima Sanka
  • 13/11/2019

Mule runtime is the engine for Anypoint Platform, combining data and application integration across legacy systems, SaaS applications, and APIs. Mule 4 is the latest and most advanced version of Mule runtime engine and has been designed to boost scalability and support performance optimisation and smooth upgrade.

At high level, the main advantages of Mule 4 are simplicity, performance and extensibility:

Simplicity: Implementing integrations with Mule 4 is simpler and faster. It takes less time and effort for projects to go live, resulting in reduced overall project costs.

Performance: Mule 4 runtime and respective connectors perform better both in terms of speed and sizing.

Extensibility: Compared to previous versions, connectors in Mule 4 are completely decoupled, which means that if you want to upgrade your connectors you don’t have to wait for your runtime engine to be upgraded.

If you want to go a step further, these are the main differences and advantages of Mule 4 compared to previous versions, as taken from our recent guide 10 things to consider when planning your Mule 4 migration.

FeatureMule 3.xMule 4.xAdvantages
RuntimeNot so smart, explicit runtime tuning available depending on the scenario.Smart – self-tuning, high performance, leverages the complete advantages of non-blocking I/O.Removes manual overhead and error-prone explicit runtime tuning configuration.No need to explicitly configure thread pool. Runtime does that for you, resulting in optimum performance.
Message structureComplex message structure with inbound, outbound properties and payload.Simplified message model with payload and attributes.Easy access to a message’s data and metadata.Simplified message model allows users to update messages making it easier to send and receive data across connectors.
Exception / Error handlingThe only way to deal with errors is by handling java exceptions.Improved error handling with on-error-continue and on-error-propagate.Simplified with built-in errors and predefined errors, specific to connector operations.New Try Scope to handle errors specific to processor.Easy to handle errors.With on-error-continue and on-error-propagate used in Try Scope, we can decide whether to continue the process or break out.Improved readability of code with a meaningful name for error types (example : DB:QUERY_EXECUTION)
ConnectorsTightly coupled to runtime, both transport and operation oriented.Independent of runtime with the introduction of isolated class loading, completely operation oriented.Connectors can be upgraded irrespective of the runtime.Completely operation oriented improves developer experience with consistency and predictability of operations across connectors.
Weaving payloadCan be updated by using Mule Expression Language, Dataweave, scripting components (using Javascript, Python, and Ruby) and direct binding with Java class implementing callable message.Payload can only be overwritten rather than being partially updated.Immutability of payload and no direct binding with java class implementing callable interface, leads in improved performance.
Data handlingUse both languages -Mule Expression Language (MEL) and Dataweave 1.0.Dataweave 2.0 replaces both languagesEasier to learn.Completely function oriented.Powerful with more built-in functions grouped into modules, which can then be imported into other flows.Can package custom reusable functions into a custom module and use it across applications.
StreamingExplicit manual configuration required to enable or disable streaming, non-repeatable streams.Streaming concept is completely abstracted and automatically handled by runtime with the introduction of repeatable streams.No explicit, error prone configurations.Very helpful when dealing with large payloads.
Enriching eventsNeed to use message enricher component.Can be achieved by configuring target variable at the connector and component levelEasier to use.


Final thoughts

To conclude, Mule 4 comes with many changes and improvements, but how easy the migration will be from a previous version will depend on many factors. If you are on a Mule 3.x version and are thinking to upgrade to Mule 4, we recommend you read our latest guide 10 things to consider when planning your Mule 4 migration.

If you would like to find out more about how you can migrate to Mule 4.x with reduced risk and disruption to your business, do give us a call at +44 (0)203 475 7980 or email us at marketing@whishworks.com

Other useful links:

5 steps to creating a Custom Policy in Mule 4

Mule 4 Accelerator

Password tokenisation in Mule 4

Latest Insights

Blogs

Introduction to: Event Streaming

In this blog we introduce the key components of event streaming, including outlining the differences between traditional batch data processing and real-time event streaming.

Dynamic Overlay for PDF Template
Blogs

Developer’s guide: creating a dynamic overlay for a PDF template

In this blog, we provide a step-by-step solution to dynamically changing the template of a PDF document using the open source software PDFbox.

Infographic Kafka banking
Blogs

Transforming Banking with Apache Kafka

In this blog (and infographic) we summarise the key takeaways from that webinar, showcasing how forward-looking banks are getting ahead of the curve with real-time streaming.