diff --git a/src/ServiceControl.Audit.Persistence/BodyStorageEnricher.cs b/src/ServiceControl.Audit.Persistence/BodyStorageEnricher.cs index be9e133bf8..a27635cb39 100644 --- a/src/ServiceControl.Audit.Persistence/BodyStorageEnricher.cs +++ b/src/ServiceControl.Audit.Persistence/BodyStorageEnricher.cs @@ -66,7 +66,9 @@ async ValueTask TryStoreBody(ReadOnlyMemory body, ProcessedMessage p catch (DecoderFallbackException e) { useBodyStore = true; - logger.LogInformation("Body for {BodyId} could not be stored embedded, fallback to body storage ({ErrorMessage})", bodyId, e.Message); + contentType = "application/octet-stream"; + processedMessage.MessageMetadata["ContentType"] = contentType; + logger.LogInformation("Body for {BodyId} is not valid UTF-8 despite content type header, storing as binary ({ErrorMessage})", bodyId, e.Message); } } diff --git a/src/ServiceControl.Persistence.RavenDB/UnitOfWork/RavenRecoverabilityIngestionUnitOfWork.cs b/src/ServiceControl.Persistence.RavenDB/UnitOfWork/RavenRecoverabilityIngestionUnitOfWork.cs index 2351e78e3e..710e256afa 100644 --- a/src/ServiceControl.Persistence.RavenDB/UnitOfWork/RavenRecoverabilityIngestionUnitOfWork.cs +++ b/src/ServiceControl.Persistence.RavenDB/UnitOfWork/RavenRecoverabilityIngestionUnitOfWork.cs @@ -53,7 +53,8 @@ public Task RecordFailedProcessingAttempt( } catch (ArgumentException) { - // If it won't decode to text, don't index it + contentType = "application/octet-stream"; + processingAttempt.MessageMetadata["ContentType"] = contentType; } } }