From 6fa5deafc26139a13720b05b0b25d2a5055fc55b Mon Sep 17 00:00:00 2001 From: Mike Thomsen Date: Tue, 18 Dec 2018 12:53:29 -0500 Subject: [PATCH] NIFI-5908 Inject locale info into JsonInjector object to make sure we don't lose that information. Signed-off-by: Pierre Villard This closes #3226. --- .../org/apache/nifi/processors/maxmind/DatabaseReader.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nifi-nar-bundles/nifi-enrich-bundle/nifi-enrich-processors/src/main/java/org/apache/nifi/processors/maxmind/DatabaseReader.java b/nifi-nar-bundles/nifi-enrich-bundle/nifi-enrich-processors/src/main/java/org/apache/nifi/processors/maxmind/DatabaseReader.java index c5ecb114b0..8cbc74aa99 100644 --- a/nifi-nar-bundles/nifi-enrich-bundle/nifi-enrich-processors/src/main/java/org/apache/nifi/processors/maxmind/DatabaseReader.java +++ b/nifi-nar-bundles/nifi-enrich-bundle/nifi-enrich-processors/src/main/java/org/apache/nifi/processors/maxmind/DatabaseReader.java @@ -57,6 +57,7 @@ public class DatabaseReader implements GeoIp2Provider, Closeable { private final Reader reader; private final ObjectMapper om; + private List locales; private DatabaseReader(final Builder builder) throws IOException { if (builder.stream != null) { @@ -74,6 +75,8 @@ public class DatabaseReader implements GeoIp2Provider, Closeable { this.om.configure(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_AS_NULL, true); InjectableValues inject = new InjectableValues.Std().addValue("locales", builder.locales); this.om.setInjectableValues(inject); + + this.locales = builder.locales; } /** @@ -259,6 +262,8 @@ public class DatabaseReader implements GeoIp2Provider, Closeable { return ip; } else if ("traits".equals(valueId)) { return new Traits(ip); + } else if ("locales".equals(valueId)) { + return locales; } return null;