File tree Expand file tree Collapse file tree 3 files changed +6
-8
lines changed
src/Experimental/src/Eventuous.Connectors.EsdbElastic Expand file tree Collapse file tree 3 files changed +6
-8
lines changed Original file line number Diff line number Diff line change 3
3
namespace Eventuous . Connectors . EsdbElastic . Index ;
4
4
5
5
public record IndexConfig {
6
+ public string IndexName { get ; init ; } = null ! ;
6
7
public DataStreamTemplateConfig ? Template { get ; init ; }
7
8
public LifecycleConfig ? Lifecycle { get ; init ; }
8
-
9
- public void Deconstruct ( out DataStreamTemplateConfig ? templateConfig , out LifecycleConfig ? lifecycleConfig ) {
10
- templateConfig = Template ;
11
- lifecycleConfig = Lifecycle ;
12
- }
13
9
}
14
10
15
11
public record DataStreamTemplateConfig {
Original file line number Diff line number Diff line change 1
- using Elasticsearch . Net ;
2
1
using Eventuous . Connectors . Base ;
3
2
using Eventuous . Connectors . EsdbElastic . Conversions ;
4
3
using Eventuous . Connectors . EsdbElastic . Index ;
27
26
. AddElasticClient ( config . ConnectionString ! , config . ApiKey ) ;
28
27
29
28
var concurrencyLimit = builder . Configuration . GetValue < uint > ( "connector:concurrencyLimit" , 1 ) ;
29
+ var subscriptionId = builder . Configuration . GetValue < string > ( "connector:subscriptionId" , "default" ) ;
30
30
31
31
new ConnectorBuilder ( )
32
- . SubscribeWith < AllStreamSubscription , AllStreamSubscriptionOptions > ( "esdb-elastic-connector" )
32
+ . SubscribeWith < AllStreamSubscription , AllStreamSubscriptionOptions > ( subscriptionId )
33
33
. ConfigureSubscriptionOptions (
34
34
cfg => {
35
35
cfg . EventSerializer = serializer ;
43
43
}
44
44
)
45
45
. ProduceWith < ElasticProducer , ElasticProduceOptions > ( )
46
- . TransformWith ( _ => new EventTransform ( "eventlog" ) )
46
+ . TransformWith ( _ => new EventTransform ( config . DataStream . IndexName ) )
47
47
. Register ( builder . Services ) ;
48
48
49
49
builder . AddStartupJob < IElasticClient , IndexConfig > ( SetupIndex . CreateIfNecessary ) ;
Original file line number Diff line number Diff line change 1
1
connector :
2
2
concurrencyLimit : 1
3
+ subscriptionId : " esdb-elastic-connector"
3
4
eventstoredb :
4
5
connectionString : " esdb://localhost:2113?tls=false"
5
6
elastic :
7
+ indexName : " eventlog"
6
8
connectionString : " http://localhost:9200"
7
9
apiKey : " "
8
10
dataStream :
You can’t perform that action at this time.
0 commit comments