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
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
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

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • Rethinking Enterprise Integration: The Understated Role of Enterprise Service Bus (ESB)
  • Creating a Mule ESB Sample Hello World Application
  • Environment Strategy for ESB Projects
  • Step By Step Guide To Using Mule ESB

Trending

  • Modular Software Architecture: Advantages and Disadvantages of Using Monolith, Microservices and Modular Monolith
  • LLMs for Bad Content Detection: Pros and Cons
  • The Systemic Process of Debugging
  • Performance Optimization Strategies in Highly Scalable Systems
  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. Performance Tuning in Mule ESB

Performance Tuning in Mule ESB

By introducing a VM connector with the help of thread configuration, you can increase the performance of your processing by more than 65%.

Rajesh Kumar user avatar by
Rajesh Kumar
·
Mar. 04, 17 · Tutorial
Like (7)
Save
Tweet
Share
16.05K Views

Join the DZone community and get the full member experience.

Join For Free

Performance plays a major role in the software lifecycle — and it is not easy! It's highly recommended to follow coding standards while developing your application.

Remember these two major topics while writing code:

  1. Thread pools.

  2. Thread profiles.

NFR (nonfunctional requirements) largely determine your design for the application. Mule applications may experience performance issues when processing large amounts of messages and messages that are large in size.

Some design recommendations for Mule applications:

  • Try to use flow references over VM endpoints.

  • Try to use connection pooling for the connectors.

  • Use Dataweave for transformations.

  • Try to avoid session variables usage in applications. Session variables are serialized and deserialized, which negatively impacts performance.

In the below sample flow, you can increase the performance.

Read the files from one directory and copy to the other directory using the file connector.

<flow name = "Fileprocess">

 <file: inbound - endpoint path = "D:\test\input"
responseTimeout = "10000"
doc: name = "File">
 </file:inbound-endpoint>


<logger level = "INFO"
doc: name = "Logger"
message = "#[message.payload]"/>
 <file: outbound - endpoint path = "D:\test\output"
responseTimeout = "10000"
doc: name = "File"/>

</flow>

In the output, it took 46 seconds to process 195 files!

Now, let's read the file from the source directory and copy it to the other directory (one by one).

Imagine if you want to read millions of files and required time to process. That would be huge!

We can reduce the processing time by introducing a VM connector with help of thread configuration.

Below is the updated flow:

<vm:connector
    name="vmtest" numberOfConcurrentTransactedReceivers="25" >
    <receiver-threading-profile  maxThreadsActive="100" maxThreadsIdle="25" />
    <dispatcher-threading-profile  maxThreadsActive="100"  maxThreadsIdle="25"  />
</vm:connector>
   <flow  name="Fileprocess">       
   <file:inbound-endpoint path="D:\test\input"
responseTimeout="10000"
 doc:name="File" >
        </file:inbound-endpoint>
         <vm:outbound-endpoint exchange-pattern="one-way" doc:name="VM" path="in" connector-ref="vmtest">

        </vm:outbound-endpoint> 

        <logger level="INFO" doc:name="Logger" message="#[message.payload]"/>
        <file:outbound-endpoint path="D:\test\output" responseTimeout="10000" doc:name="File"/>

</flow>

In the output, it took 18 seconds to process 195 files!

We've increased the performance more than 65%.

Both flow outputs are same, but the processing time changes.

Mule connectors support dispatch and receiving profiles.

  • Dispatch: Threads used to send messages out.

  • Receiver: Threads used in message source.

Feedback is welcome!

Enterprise service bus

Opinions expressed by DZone contributors are their own.

Related

  • Rethinking Enterprise Integration: The Understated Role of Enterprise Service Bus (ESB)
  • Creating a Mule ESB Sample Hello World Application
  • Environment Strategy for ESB Projects
  • Step By Step Guide To Using Mule ESB

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • 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: