DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Because the DevOps movement has redefined engineering responsibilities, SREs now have to become stewards of observability strategy.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Related

  • Implement Hibernate Second-Level Cache With NCache
  • Modify JSON Data in Postgres and Hibernate 6
  • Develop XR With Oracle Cloud, Database on HoloLens, Ep 2: Property Graphs, Data Visualization, and Metaverse
  • When Drones Go Dark

Trending

  • Traditional Testing and RAGAS: A Hybrid Strategy for Evaluating AI Chatbots
  • Navigating and Modernizing Legacy Codebases: A Developer's Guide to AI-Assisted Code Understanding
  • Advancing Robot Vision and Control
  • The Perfection Trap: Rethinking Parkinson's Law for Modern Engineering Teams
  1. DZone
  2. Data Engineering
  3. Data
  4. Mule Message Data and Expression Language

Mule Message Data and Expression Language

We take a look at Mule Express Language (MEL), what it can be used to do, as well as how to use the data generated by Mule Message.

By 
Pryank Gupta user avatar
Pryank Gupta
·
Mar. 10, 18 · Analysis
Likes (8)
Comment
Save
Tweet
Share
37.8K Views

Join the DZone community and get the full member experience.

Join For Free

Accessing information about Mule messages using Datasense :

  • DataSense is Anypoint Studio’s ability to proactively discover metadata from internal and external resources.

  • Keeps you from having to manually discover information about the data.

  • Facilitates transformations by providing DataWeave expected input or output.

  • We saw this with Transform Message component.

Image title

Other ways to view message information :

  • Add a Logger component to a flow and view its output in the Anypoint Studio console.

  • Use the Anypoint Studio Visual Debugger which is the most comprehensive way. We also have a Mule Expression Evaluator.

  • Use autocomplete when writing expressions in the Anypoint Studio Visual Editor.

Image title

Reviewing the structure of Mule messages:

  • Mule message is a core part of mule applications.

  • Message processors may or may not modify Mule messages.

  • We can enrich Mule messages through Message Enricher which is a part of Mule's advanced training.

Image title

Message Properties :

  • Inbound properties

    • Set from the message source

    • Read-only access

    • Persist throughout the flow

  • Outbound properties

    • Added by

    • Read/write access

    • Can set, remove, copy 

Image title

Inbound message properties :

  • These message properties are read only.

  • Query parameters, URI parameters, Method name, and Content-type are examples of inbound properties.

Image title

Outbound message properties:

  • We can use the Set Property transformer to set outbound properties.

Image title

Payload representation:

  • This is a core part of Mule Message.

  • We can use Set Payload or the Ddataweave Transformer to modify payloads accordingly.

Image title

Setting message properties:

Image title

Debugging applications with the Mule Debugger:

  • Locate the port used by the Mule Debugger.

  • Add a breakpoint, debug an application, and step through the code.

  • Use the Mule Debugger to view message properties.

  • Pass query parameters to a request and locate them in the Debugger.

  • You can add breakpoints to processors and step through the application.

  • By default, Debugger listens for incoming TCP connections on localhost port 6666.

Image title

Mule Expression Language (MEL):

  • Use MEL to access and evaluate the data in the payload, properties, and variables of a Mule message.

  • MEL is a lightweight, Mule-specific expression language.

  • Accessible and usable from within virtually every message processor in Mule.

  • Is used to modify the way the processors act upon the message such as routing or filtering.

  • Makes use of Mule-specific context objects.

  • Case-sensitive.

  • Easy to use with autocomplete everywhere.

Basic MEL Syntax:

Image title

Context Objects:

Image title

Accessing message data:

Image title

Accessing message payload data:

Image title

Accessing relational map data :

Image title

Accessing relational map data :

  • Evaluation: ==, !=, >, <, >=, <=, contains, is #[message.inboundProperties.'http.query.params'.lastname != null]

  • The literal empty tests the emptiness of a value.

  • XPath: #[xpath('expression')]

  • RegEx: #[regex('expression')]

Data (computing) Property (programming)

Opinions expressed by DZone contributors are their own.

Related

  • Implement Hibernate Second-Level Cache With NCache
  • Modify JSON Data in Postgres and Hibernate 6
  • Develop XR With Oracle Cloud, Database on HoloLens, Ep 2: Property Graphs, Data Visualization, and Metaverse
  • When Drones Go Dark

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!