If large messages are expected, use an Attachment Handler to improve throughput and reduce memory and disk usage.
When a channel processes a message, copies of the message content are made in memory at various steps in which the message is transformed. Depending on the message storage mode, multiple copies of the transformed content are also written to the disk/database. Due to this, large messages can quickly consume memory and can cause out-of-memory errors if one is not careful. An attachment handler can mitigate these problems by extracting the bulk of the message content that does not need to undergo transformation while passing through the channel.
For more information about attachment handlers, please see the official User Guide.