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

  • Error Handling Inside Kumologica Subflow
  • How to Use Mulesoft VM Connector
  • Step-by-Step Guide to Use Anypoint MQ: Part 2
  • Leveraging Natural Language Processing for Enhancing Sales Chatbots

Trending

  • How GitHub Copilot Helps You Write More Secure Code
  • After 9 Years, Microsoft Fulfills This Windows Feature Request
  • How Large Tech Companies Architect Resilient Systems for Millions of Users
  • Caching 101: Theory, Algorithms, Tools, and Best Practices
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. Mule Sub-Flows, Processing Strategy, and One-Way Endpoints

Mule Sub-Flows, Processing Strategy, and One-Way Endpoints

Interested in learning more about Mule? Read on to get an overview of sub-flows, processing strategy, and one-way endpoints.

By 
Pryank Gupta user avatar
Pryank Gupta
·
Mar. 09, 18 · Analysis
Likes (11)
Comment
Save
Tweet
Share
35.0K Views

Join the DZone community and get the full member experience.

Join For Free

Benefits of breaking up flows into separate flows and subflows:

  • Makes the graphical view more intuitive, you don’t want long flows that go off the screen.

  • Makes XML code easier to read.

  • Enables code reuse.

  • Provides separation between an interface and implementation.

  • Makes them easier to test.

Subflows:

  • Subflows are executed exactly as if the processors were still in the calling flow.

  • Always run synchronously in the same thread.

  • Inherit the processing and exception strategies of the flow that triggered its execution.

Image title

Flows:

  • Flows, on the other hand, have much more flexibility in how they are used.

    • They cn have their own processing and exception strategies.

    • They can be synchronous or asynchronous.

  • Flows without message sources are sometimes called private flows.

Image title

Processing Strategy:

  • A flow processing strategy determines how Mule implements message processing for a given flow.

    • Should the message be processed synchronously (on the same thread) or asynchronously (on a different thread)?

      • If asynchronously, what are the properties of the pool of threads used to process the messages?

      • If asynchronously, how will messages wait for their turn to be processed in the second thread?

Flows contain 3 thread pools:

  • Receiving - Message source's threads.

  • Flow processing - Message processor's threads.

  • Dispatching - Outbound endpoint's threads.

Image title

Use of pools depends on a flow's behavior :

Image title

Staged Event Driven Architecture (SEDA):

  • The architecture upon which Mule was built.

  • Decouples receiving, processing, and dispatching phases.

  • Supports higher levels of parallelism in specific stages of processing.

  • Allows for more-specific tuning of areas within a flow's architecture.

What determines a flow’s processing strategy?

  • Mule automatically sets a flow to be Synchronous or queued-asynchronous.

  • A flow is set to synchronous if the message source is request-response.

  • The flow partakes in a transaction.

  • Otherwise, a flow is set to queued-asynchronous. The message source is not expecting a response.

Synchronous flows:

  • When a flow receives a message, all processing, including the processing of the response, is done in the same thread.

  • Uses only the message source's thread pool.

  • The flow's thread pool is elastic and will have one idle thread that is never used.

  • Tuning for higher-throughput happens on the connector receiver's level.

Image title

Queued-asynchronous flows:

  • Decouples and uses all 3 thread pools.

  • Uses queues, whose threads drop messages off for the subsequent pool's thread to pick up.

  • Pools, queues, and behaviors of this strategy are configurable.

  • By default, the flow thread pool has 16 threads.

Image title

Creating flows and subflows:

  • Use flow scope to create a new flow or drag any message processor to the canvas.

  • Use subflow scope to create subflows.

  • Use Flow Reference component to pass messages to other flows or subflows.

  • Flow variables persist through all flows unless the message crosses a transport boundary.

Image title

Setting the flow processing strategy:

  • The flow processing strategy is automatically set.

  • It can be changed in the flow’s properties view.

  • This is usually done when a custom queued-asynchronous profile has been created for tuning application performance.

Image title

Using VM endpoints in flows - The Java Virtual Machine (VM) transport:

  • The Java Virtual Machine (VM) transport can be used for intra-JVM communication between Mule flows.

  • Each app in a Mule instance has its own, unique set of VM endpoints.

  • The VM transport can only handle communications within an app or between apps in the same domain.

  • This transport by default uses in-memory queues but can optionally be configured to use persistent queues.

  • Before Mule 3, the VM transport was needed to pass a message from one flow to another.

  • In Mule 3, Flow Reference was added to let flows directly reference one another without a transport in the middle.

  • VM transport is now mostly used to:

         - Achieve higher levels of parallelism in specific stages of processing.

         - Allow for more-specific tuning of areas within a flow's architecture.

         - Call flows in other applications that are in the same domain.

Image title

Processing Flow (web browser) Virtual Machine

Opinions expressed by DZone contributors are their own.

Related

  • Error Handling Inside Kumologica Subflow
  • How to Use Mulesoft VM Connector
  • Step-by-Step Guide to Use Anypoint MQ: Part 2
  • Leveraging Natural Language Processing for Enhancing Sales Chatbots

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!