diff --git a/data-prepper-plugins/opensearch/src/main/java/org/opensearch/dataprepper/plugins/sink/opensearch/OpenSearchSink.java b/data-prepper-plugins/opensearch/src/main/java/org/opensearch/dataprepper/plugins/sink/opensearch/OpenSearchSink.java index c8d0b9b2aa..7024abe91d 100644 --- a/data-prepper-plugins/opensearch/src/main/java/org/opensearch/dataprepper/plugins/sink/opensearch/OpenSearchSink.java +++ b/data-prepper-plugins/opensearch/src/main/java/org/opensearch/dataprepper/plugins/sink/opensearch/OpenSearchSink.java @@ -185,8 +185,6 @@ public OpenSearchSink(final PluginSetting pluginSetting, dlqPluginSetting.setPipelineName(pluginSetting.getPipelineName()); dlqProvider = pluginFactory.loadPlugin(DlqProvider.class, dlqPluginSetting); } - - this.objectMapper = new ObjectMapper(); } @Override @@ -261,6 +259,8 @@ private void doInitializeInternal() throws IOException { // Attempt to update the serverless network policy if required argument are given. maybeUpdateServerlessNetworkPolicy(); + + this.objectMapper = new ObjectMapper(); this.initialized = true; LOG.info("Initialized OpenSearch sink"); }