Skip to content

Operations

The Chunking Connector provides operations for streaming large binary files into manageable chunks.

Available Operations

OperationDescriptionOutput
read-chunkedStreams binary content into chunksStream of chunk objects

Planned Future Operations

The connector is designed to support additional chunking strategies in future releases:

Planned OperationDescriptionStatus
reassembleCombine chunks back into original binary contentPlanned
read-linesStream text files line-by-linePlanned
read-delimitedSplit text by custom delimiterPlanned

Contribution Welcome

Interested in contributing? Check out our GitHub repository for contribution guidelines.

Operation Details

read-chunked

The primary operation for binary streaming. It reads an InputStream and returns a PagingProvider that yields Chunk objects lazily.

Key Features:

  • Constant memory usage (O(chunkSize))
  • Lazy evaluation - chunks created on-demand
  • 1-byte probe technique for accurate last chunk detection
  • Compatible with Mule's <foreach> component

Learn More: read-chunked Operation Reference

Usage Pattern

All operations follow a consistent pattern:

xml
<!-- 1. Get input stream (from file, HTTP, etc.) -->
<file:read path="/path/to/file"/>

<!-- 2. Apply chunking operation -->
<chunking:read-chunked chunkSize="1048576"/>

<!-- 3. Process chunks with foreach -->
<foreach>
    <!-- Handle each chunk -->
    <logger message="Processing chunk #[payload.index]"/>
</foreach>

This pattern ensures:

  • Memory-efficient processing
  • Consistent error handling
  • Progress tracking capabilities
  • Interoperability with other Mule connectors

Released under the MIT License.