Closed mookid8000 closed 5 years ago
Rebus 6 (which is currently available as version 6.0.0-b08) can do this:
Configure.With(_activator)
.Transport(t => ...)
.DataBus(d =>
{
d.SendBigMessagesAsAttachments(bodySizeThresholdBytes: 2*1024*1024);
d.StoreInMemory(_dataStore);
})
.Start();
where SendBigMessagesAsAttachments
is obviously what we're after here 😄
If the size of the message payload exceeds the size limit for the configured transport, it would be neat if Rebus could automatically store the payload as an attachment, and then just send a message with an attachment ID.
This feature requires that Rebus can help with cleaning up old attachments, so this feature must be accompanied by #750 . This way, enabling this feature would require that some kind of clean-up strategy be defined, e.g. "clean up attachments that haven't been read for 72 hours", or something like that.
This would also solve the issue described here.