Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Shared.EventStore/Subscriptions/PersistentSubscription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public async Task ConnectToSubscription()
this.EventAppeared,
this.SubscriptionDropped,
this.UserCredentials,
200,
this.PersistentSubscriptionDetails.InflightCount == 0 ? 200 : this.PersistentSubscriptionDetails.InflightCount,
false);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ public record PersistentSubscriptionDetails
/// <param name="streamName">Name of the stream.</param>
/// <param name="groupName">Name of the group.</param>
public PersistentSubscriptionDetails(String streamName,
String groupName)
String groupName,
Int32 inflightCount)
{
this.StreamName = streamName;
this.GroupName = groupName;
this.InflightCount = inflightCount;
}

#endregion
Expand All @@ -38,6 +40,8 @@ public PersistentSubscriptionDetails(String streamName,
/// </value>
public String StreamName { get; init; }

public Int32 InflightCount { get; init; }

#endregion

#region Methods
Expand Down
4 changes: 3 additions & 1 deletion Shared.EventStore/Subscriptions/SubscriptionWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public override async Task StopAsync(CancellationToken cancellationToken)
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
Boolean useInternalSubscriptionService = Boolean.Parse(ConfigurationReader.GetValue("UseInternalSubscriptionService"));
String inflightMessageCount = ConfigurationReader.GetValue("InflightMessages");

if (useInternalSubscriptionService == false)
return;
Expand Down Expand Up @@ -137,7 +138,8 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
this.LogInformation($"Creating subscription {subscriptionDto.EventStreamId}-{subscriptionDto.GroupName}");

PersistentSubscriptionDetails persistentSubscriptionDetails = new(subscriptionDto.EventStreamId, subscriptionDto.GroupName);
PersistentSubscriptionDetails persistentSubscriptionDetails = new(subscriptionDto.EventStreamId, subscriptionDto.GroupName,
String.IsNullOrEmpty(inflightMessageCount) ? 0 : Int32.Parse(inflightMessageCount));

PersistentSubscription subscription = PersistentSubscription.Create(this.PersistentSubscriptionsClient,
persistentSubscriptionDetails,
Expand Down