From 11989970035ce112c2ac9c401b92de41215d031f Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 5 Apr 2023 13:29:14 +0200 Subject: [PATCH] Ensure IndexChannel and DatastreamChannel have constructor with callbackListeners (#27) --- .../DataStreams/DataStreamChannel.cs | 6 +++++- src/Elastic.Ingest.Elasticsearch/Indices/IndexChannel.cs | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Elastic.Ingest.Elasticsearch/DataStreams/DataStreamChannel.cs b/src/Elastic.Ingest.Elasticsearch/DataStreams/DataStreamChannel.cs index 2b35290..da2e6bd 100644 --- a/src/Elastic.Ingest.Elasticsearch/DataStreams/DataStreamChannel.cs +++ b/src/Elastic.Ingest.Elasticsearch/DataStreams/DataStreamChannel.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Linq; using Elastic.Channels; +using Elastic.Channels.Diagnostics; using Elastic.Ingest.Elasticsearch.Serialization; using Elastic.Ingest.Transport; @@ -16,7 +17,10 @@ public class DataStreamChannel : ElasticsearchChannelBase - public DataStreamChannel(DataStreamChannelOptions options) : base(options) + public DataStreamChannel(DataStreamChannelOptions options) : this(options, null) { } + + /// + public DataStreamChannel(DataStreamChannelOptions options, ICollection>? callbackListeners) : base(options, callbackListeners) { var target = Options.DataStream.ToString(); _fixedHeader = new CreateOperation { Index = target }; diff --git a/src/Elastic.Ingest.Elasticsearch/Indices/IndexChannel.cs b/src/Elastic.Ingest.Elasticsearch/Indices/IndexChannel.cs index d8f208b..f49786a 100644 --- a/src/Elastic.Ingest.Elasticsearch/Indices/IndexChannel.cs +++ b/src/Elastic.Ingest.Elasticsearch/Indices/IndexChannel.cs @@ -2,6 +2,8 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information using System; +using System.Collections.Generic; +using Elastic.Channels.Diagnostics; using Elastic.Ingest.Elasticsearch.DataStreams; using Elastic.Ingest.Elasticsearch.Serialization; using Elastic.Ingest.Transport; @@ -14,7 +16,10 @@ namespace Elastic.Ingest.Elasticsearch.Indices public class IndexChannel : ElasticsearchChannelBase> { /// - public IndexChannel(IndexChannelOptions options) : base(options) + public IndexChannel(IndexChannelOptions options) : this(options, null) { } + + /// + public IndexChannel(IndexChannelOptions options, ICollection>? callbackListeners) : base(options, callbackListeners) { TemplateName = string.Format(Options.IndexFormat, "template"); TemplateWildcard = string.Format(Options.IndexFormat, "*");