Skip to content

Commit

Permalink
Recover decoded attributes before scrubbing messages
Browse files Browse the repository at this point in the history
  • Loading branch information
jklukas committed Aug 13, 2019
1 parent e00728f commit dd09b4f
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ protected PubsubMessage processElement(PubsubMessage message)
throw e;
}

// In case this message is being replayed from an error output where AddMetadata has already
// been applied, we strip out any existing metadata fields and put them into attributes.
AddMetadata.stripPayloadMetadataToAttributes(attributes, json);

if (MessageScrubber.shouldScrub(attributes, json)) {
// Prevent the message from going to success or error output.
throw new MessageShouldBeDroppedException();
}

// In case this message is being replayed from an error output where AddMetadata has already
// been applied, we strip out any existing metadata fields and put them into attributes.
AddMetadata.stripPayloadMetadataToAttributes(attributes, json);

boolean validDocType = schemaStore.docTypeExists(attributes);
if (!validDocType) {
PerDocTypeCounter.inc(null, "error_invalid_doc_type");
Expand Down

0 comments on commit dd09b4f

Please sign in to comment.