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
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Reactive Kafka With Streaming in Spring Boot
  • The Serverless Illusion: When “Pay for What You Use” Becomes Expensive
  • From Compliance Pipes to Data Streams: Modernizing Healthcare EDI for Strategic Value
  • Memory Optimization and Utilization in Java 25 LTS: Practical Best Practices

Trending

  • How to Format Articles for DZone
  • The Agent Protocol Stack: MCP vs. A2A vs. AG-UI
  • Why Good Models Fail After Deployment
  • Why SAP S/4HANA Landscape Design Impacts Cloud TCO More Than Compute Costs
  1. DZone
  2. Coding
  3. JavaScript
  4. Different Streaming Strategies in Mule 4

Different Streaming Strategies in Mule 4

We will go through one of the most important concepts of MuleSoft Streaming strategies. There are 3 types of streaming strategies available in MuleSoft.

By 
vikas puri user avatar
vikas puri
·
Apr. 03, 21 · Review
Likes (3)
Comment
Save
Tweet
Share
26.6K Views

Join the DZone community and get the full member experience.

Join For Free

In this article, we will go through one of the most important concepts of MuleSoft Streaming strategies.

There are three types of streaming strategies available in MuleSoft:

  • Repeatable file store stream (by default, this strategy is selected).
  • Non repeatable stream.
  • Repeatable in-memory stream.

Following is the snippet for the same:

Drop-down selection menu

Let us try to understand each one of them step by step:

Repeatable File Store Stream

This streaming strategy is selected by default.

Before proceeding, let us consider a simple scenario like we have 0.1vCore (512MB memory) and our application is deployed, what will happen if you pass 1 GB of payload. Will it throw some exception or will execute successfully?

If you think, it will execute successfully then you are right, because by default 'Repeatable file store stream' strategy is selected. 

How Does It Work?

In reality, for 0.1 vCore there is 8GB of memory available, what MuleSoft provides to us is 512 MB as Heap memory. After 512 MB is full, data will be stored in the disk storage which is the remaining memory (8GB - 512MB (some installations let us assume 1.5 GB)).

Following are some of the advantages:

  • As it stores data in the memory and disk, so you can pass input payload of more size than heap size.
  • As the name suggests repeatable, once you read the data, and you want to read the same data somewhere else you can read that as data is backed up in disk storage.

Non Repeatable Stream

In this streaming strategy, when the very first time you are reading the input payload, the memory assignment and everything work as Repeatable File Stream strategy but once read, the payload data will be cleared from the memory and disk space, and you cannot read it again.

Repeatable In-Memory Stream

This streaming strategy is a bit different from others. In this, the data will be stored in memory (heap memory), it will not be stored in disk space. So if you pass payload more than heap size, it will throw memory out of bound exception.

Conclusion

We here learned different streaming strategies like Repeatable file store, Non-Repeatable, Repeatable Stream.

Memory (storage engine) Stream (computing)

Opinions expressed by DZone contributors are their own.

Related

  • Reactive Kafka With Streaming in Spring Boot
  • The Serverless Illusion: When “Pay for What You Use” Becomes Expensive
  • From Compliance Pipes to Data Streams: Modernizing Healthcare EDI for Strategic Value
  • Memory Optimization and Utilization in Java 25 LTS: Practical Best Practices

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • 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