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
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

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
  • Engineering Data Observability: Detecting Schema Drift, Data Drift, and Silent Pipeline Failures

Trending

  • Why We Chose Iceberg Over Delta After Evaluating Both at Scale
  • MySQL Instant DDL: Metadata Locks, Waiting Writers, and Query Pileups
  • Delegated Transport, Forked Authorization: Where Chat and AI-Agent Integrations Actually Break
  • Two AI Agents, One Database: Solving Concurrent Updates With Optimistic Locking

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  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
·
Mar. 10, 18 · Analysis
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
38.2K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

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
  • Engineering Data Observability: Detecting Schema Drift, Data Drift, and Silent Pipeline Failures

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

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 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook