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

  • Modernizing a Legacy Java Application With OpenRewrite: What We Automated and What We Didn't
  • Idempotency Under Concurrency: Why Your Application Check Isn't the Last Line of Defense
  • Running a Self-Hosted WAF in Production: Practical Lessons From SafeLine
  • Your Application Has an Unindexed Attack Surface. Do You Know What’s in It?

Trending

  • Stop Writing Database Migration Scripts: Declarative Schema Sync for Java
  • Securing AI Agents in Production: A Developer’s Guide To Prompt Injection, RAG Leaks, and Tool Abuse
  • From Issue to Reviewable Patch: Build a Sandboxed Coding Agent With Deep Agents and Automated Tests
  • The Rise of the Unsanctioned Agent Swarm

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.

Reliability Pattern in Mule

This article talks about ensuring the reliability of your HTTP application with the reliability pattern provided by Mule.

By 
Anupam Gogoi
·
Aug. 04, 17 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
13.1K 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

A reliable application is one that can not tolerate a single loss of information. For an application to be reliable, apart from the underlying ESB being highly reliable, it is necessary that the connections made by the application to other services must be reliable too. If the application uses a transactional transport such as JMS, VM, or JDBC, reliable messaging is ensured by the built-in support for transactions in the transports. This means that you can configure a transaction on a JMS inbound endpoint that makes sure messages are only removed from the JMS server when the transaction is committed.

However, most of the time, we use connections that are not reliable. For example, HTTP transport. How would you ensure reliability in an HTTP application? This is the point of discussion of this article.

Reliability Pattern

The reliability pattern provided by Mule ensures that the messaging is reliable for an application even though application receives messages from a non-transactional transport. Here comes the best use of VM connector.

Scenario

Let's assume the simplest virtual scenario as depicted below:

Image title

In the scenario above, we receive an order on an HTTP endpoint. Then we log the order, and finally, send the order to SalesForce for further processing. Our application must be highly reliable, i.e we can not lose a single piece of order information.

Now assume that the application has received an order information and suddenly the Mule ESB went down. So, your order is definitely gone. How do you tackle this problem? Here is how the Reliability Pattern comes into play.

Refactor the Application

Let's refactor the above application as shown below:

Image title

This approach is exactly same as using JMS queue. But fortunately, by using the VM Connector in Mule, you don't incur the administrative cost and performance overhead of running a separate JMS Broker.

You can make the VM Connector persistent by applying the Queue Store configuration as shown below:

Image title

In my case, the message passed over the queue (orderqueue in the example) will be persisted to the disk of the machine. So in the event of a Mule shutdown or failure, it will still be delivered to the HTTP outbound endpoint.

Also, the characteristics of how the VM transport stores its messages can be configured by defining the queue profile VM connector.

Conclusion

Using just the simple VM Connector provided by Mule, a simple non-transactional flow can be made highly reliable. Also, instead of using the VM Connector, the JMS connector can also be used to implement the reliability pattern.

application

Opinions expressed by DZone contributors are their own.

Related

  • Modernizing a Legacy Java Application With OpenRewrite: What We Automated and What We Didn't
  • Idempotency Under Concurrency: Why Your Application Check Isn't the Last Line of Defense
  • Running a Self-Hosted WAF in Production: Practical Lessons From SafeLine
  • Your Application Has an Unindexed Attack Surface. Do You Know What’s in It?

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