Remember that we can have very large binary bodies that we always need to
store for the failed messages.

The plan was:

1. For errors: always store as attachment
2. For audits: store in document but only if content is text and less than
100 kb

What drawbacks do we see?

Given the bug we found in raven where a byte[] doesn't store correctly I'd
say attachments does the job?


On Tue, Feb 18, 2014 at 8:43 PM, Itamar Syn-Hershko <
notifications@github.com> wrote:

> In src/ServiceControl/Operations/BodyStorage/BodyStorageEnricher.cs:
>
> >                  message.Metadata.Add("BodyUrl", bodyUrl);
> >              }
> >
> > -            message.Metadata.Add("BodySize", bodySize);
> > +            if (!contentType.Contains("binary") && bodySize <= MaxBodySizeToStore)
> > +            {
> > +                message.Metadata.Add("Body", System.Text.Encoding.UTF8.GetString(message.PhysicalMessage.Body));
> > +            }
>
> @johnsimons <https://github.com/johnsimons> I think you mixed 2 different
> concepts here
>
> We want to phase out the use of attachments completely; this will save on
> operations (one write per msg instead of 2), and also will not be another
> thing to track when expiring messages.
>
> What we decided was to store message bodies for failed messages (always,
> no matter what), and for non-binary audit messages which are not too big
> (up to 100 or 500kb).
>
> This thing here sort of does both half way. Or am I missing something?
>
> /cc @andreasohlund <https://github.com/andreasohlund>
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/Particular/ServiceControl/pull/235/files#r9838432>
> .
>