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

  • Stop Poisoning Your Models: How I Built a CV Dataset Quality Toolkit I Can Reuse Forever
  • Advanced Auto Loader Patterns for Large-Scale JSON and Semi-Structured Data
  • From 13,000 to 20,000+ Endpoints: Architecting Forensics for the Remote Workforce
  • Architecting Scalable JSON Pipelines: The Power of a Single PySpark Schema

Trending

  • When a Coding Agent Fixes the Test Instead of the Bug
  • Part 4: Multi-Agent Orchestration — Pairing Goose With Quarkus Flow State Machines
  • Architecture Review Boards for Generative AI: A Framework for Governance, Risk Management, and Responsible Adoption
  • How to Migrate From C/C++ to Rust: A Practical Guide for Embedded IoT Systems

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. Posting JSON Data to a Mule Flow

Posting JSON Data to a Mule Flow

There are only 11 steps to POSTing JSON data to a Mule flow. JSON data can be sent directly to a Mule flow. The reason for doing this is to access data from a payload.

By 
Danish Sheikh
·
Mar. 08, 17 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
27.0K 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

This is an example that showcases how data in JSON format can be sent directly to a Mule flow. The JSON data can be accessed using the Mule expression language inside the flow.

We will keep the flow simple, as accessing the data from the payload is the reason for this example.

11 Steps to POSTing JSON Data to a Mule Flow

  1. Open Anypoint Studio.

  2. Create a new Mule project. Click File > New > Mule Project.

  3. Name the project JsonAccess and click Finish.

  4. Drag the HTTP Connector from the palette onto the canvas. Click HTTP connector to open the properties window as shown below:Connector Setting Initial

  5. Click + to enter the connector settings.Connector Configuration Detail

  6. Click OK. Now add POST against Method so that only POST is allowed on /.Connector Setting

  7. Drag Logger from the palette next to the HTTP connector on the canvas. Click Logger the on canvas and enter #[json:productid] as the value for the Message.logger details

  8. Save and your run project.

  9. Open Postman. Prepare the request as shown in the image below:Image titleMake sure POST is selected as the method. Under the Body tab, choose raw and change mime to JSON (application/json). The content which we willPOST is {"productid":"6","productname":"Shampoo"}.

  10. Click Send. Go back to Anypoint Studio.

  11. Under Console, we can see the logger output as 6:Image title

Conclusion

We have successfully POSTed JSON data in the request body from Postman to the Mule application!

JSON Data (computing) Flow (web browser)

Opinions expressed by DZone contributors are their own.

Related

  • Stop Poisoning Your Models: How I Built a CV Dataset Quality Toolkit I Can Reuse Forever
  • Advanced Auto Loader Patterns for Large-Scale JSON and Semi-Structured Data
  • From 13,000 to 20,000+ Endpoints: Architecting Forensics for the Remote Workforce
  • Architecting Scalable JSON Pipelines: The Power of a Single PySpark Schema

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