[
https://issues.apache.org/jira/browse/NIFI-5284?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16507265#comment-16507265
]
ASF GitHub Bot commented on NIFI-5284:
--------------------------------------
Github user zenfenan commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2776#discussion_r194246883
--- Diff:
nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/AbstractMongoProcessor.java
---
@@ -275,4 +303,13 @@ protected void writeBatch(String payload, FlowFile
parent, ProcessContext contex
session.getProvenanceReporter().receive(flowFile, getURI(context));
session.transfer(flowFile, rel);
}
+
+ protected void configureMapper(String setting) {
--- End diff --
@MikeThomsen I again went through the link @joewitt shared. Anyway, we are
configuring `objectMapper` before using it, at least in this case. That
guarantees thread safety. https://stackoverflow.com/a/3909846/2973446. Anyway I
have marked it synchronized. Let me know, if there are any concerns.
@joewitt If you see something odd with this one, please share it over here.
> RunMongoAggregation uses ObjectIdSerializer & SimpleDateFormat
> --------------------------------------------------------------
>
> Key: NIFI-5284
> URL: https://issues.apache.org/jira/browse/NIFI-5284
> Project: Apache NiFi
> Issue Type: Improvement
> Components: Extensions
> Affects Versions: 1.6.0
> Reporter: Zambonilli
> Assignee: Sivaprasanna Sethuraman
> Priority: Minor
>
> The RunMongoAggregation processor uses Jackson to serialize the document to
> JSON. However, the default serialization for Jackson on Mongo ObjectId and
> dates leaves a lot to be desired. The ObjectId's are serialized into the
> decimal representation of each component of the ObjectId instead of the hex
> string of the full byte array. Mongo dates are being serialized as unix time
> as opposed to ISO8601 zulu string.
> It looks like the GetMongo processor has set the correct serializer flags on
> Jackson to fix this. The fix for GetMongo is here.
> https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java#L213
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)