Skip to content

Commit

Permalink
Merge pull request #198 from EventStore/hayley-jean/align-psub-settings
Browse files Browse the repository at this point in the history
Align persistent subscription names with RFC
  • Loading branch information
timothycoleman authored Feb 15, 2022
2 parents 374da1b + 4b5e632 commit 1b5e6d1
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion samples/persistent-subscriptions/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static async Task UpdatePersistentSubscription(EventStorePersistentSubscriptions
var userCredentials = new UserCredentials("admin", "changeit");
var settings = new PersistentSubscriptionSettings(
resolveLinkTos: true,
minCheckPointCount: 20);
checkPointLowerBound: 20);

await client.UpdateAsync(
"test-stream",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,11 @@ private async Task CreateInternalAsync(string streamName, string groupName, IEve
ResolveLinks = settings.ResolveLinkTos,
HistoryBufferSize = settings.HistoryBufferSize,
LiveBufferSize = settings.LiveBufferSize,
MaxCheckpointCount = settings.MaxCheckPointCount,
MaxCheckpointCount = settings.CheckPointUpperBound,
MaxRetryCount = settings.MaxRetryCount,
MaxSubscriberCount = settings.MaxSubscriberCount,
MinCheckpointCount = settings.MinCheckPointCount,
NamedConsumerStrategy = NamedConsumerStrategyToCreateProto[settings.NamedConsumerStrategy],
MinCheckpointCount = settings.CheckPointLowerBound,
NamedConsumerStrategy = NamedConsumerStrategyToCreateProto[settings.ConsumerStrategyName],
ReadBatchSize = settings.ReadBatchSize
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,12 @@ public async Task UpdateAsync(string streamName, string groupName, PersistentSub
ResolveLinks = settings.ResolveLinkTos,
HistoryBufferSize = settings.HistoryBufferSize,
LiveBufferSize = settings.LiveBufferSize,
MaxCheckpointCount = settings.MaxCheckPointCount,
MaxCheckpointCount = settings.CheckPointUpperBound,
MaxRetryCount = settings.MaxRetryCount,
MaxSubscriberCount = settings.MaxSubscriberCount,
MinCheckpointCount = settings.MinCheckPointCount,
MinCheckpointCount = settings.CheckPointLowerBound,
NamedConsumerStrategy =
NamedConsumerStrategyToUpdateProto[settings.NamedConsumerStrategy],
NamedConsumerStrategyToUpdateProto[settings.ConsumerStrategyName],
ReadBatchSize = settings.ReadBatchSize
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ public sealed class PersistentSubscriptionSettings {
public readonly TimeSpan CheckPointAfter;

/// <summary>
/// The minimum number of messages to write to a checkpoint.
/// The minimum number of messages to process before a checkpoint may be written.
/// </summary>
public readonly int MinCheckPointCount;
public readonly int CheckPointLowerBound;

/// <summary>
/// The maximum number of messages not checkpointed before forcing a checkpoint.
/// </summary>
public readonly int MaxCheckPointCount;
public readonly int CheckPointUpperBound;

/// <summary>
/// The maximum number of subscribers allowed.
Expand All @@ -69,7 +69,7 @@ public sealed class PersistentSubscriptionSettings {
/// <summary>
/// The strategy to use for distributing events to client consumers. See <see cref="SystemConsumerStrategies"/> for system supported strategies.
/// </summary>
public readonly string NamedConsumerStrategy;
public readonly string ConsumerStrategyName;

/// <summary>
/// Constructs a new <see cref="PersistentSubscriptionSettings"/>.
Expand All @@ -83,16 +83,16 @@ public sealed class PersistentSubscriptionSettings {
/// <param name="readBatchSize"></param>
/// <param name="historyBufferSize"></param>
/// <param name="checkPointAfter"></param>
/// <param name="minCheckPointCount"></param>
/// <param name="maxCheckPointCount"></param>
/// <param name="checkPointLowerBound"></param>
/// <param name="checkPointUpperBound"></param>
/// <param name="maxSubscriberCount"></param>
/// <param name="namedConsumerStrategy"></param>
/// <param name="consumerStrategyName"></param>
/// <exception cref="ArgumentOutOfRangeException"></exception>
public PersistentSubscriptionSettings(bool resolveLinkTos = false, IPosition? startFrom = null,
bool extraStatistics = false, TimeSpan? messageTimeout = null, int maxRetryCount = 10,
int liveBufferSize = 500, int readBatchSize = 20, int historyBufferSize = 500,
TimeSpan? checkPointAfter = null, int minCheckPointCount = 10, int maxCheckPointCount = 1000,
int maxSubscriberCount = 0, string namedConsumerStrategy = SystemConsumerStrategies.RoundRobin) {
TimeSpan? checkPointAfter = null, int checkPointLowerBound = 10, int checkPointUpperBound = 1000,
int maxSubscriberCount = 0, string consumerStrategyName = SystemConsumerStrategies.RoundRobin) {
messageTimeout ??= TimeSpan.FromSeconds(30);
checkPointAfter ??= TimeSpan.FromSeconds(2);

Expand All @@ -117,10 +117,10 @@ public PersistentSubscriptionSettings(bool resolveLinkTos = false, IPosition? st
ReadBatchSize = readBatchSize;
HistoryBufferSize = historyBufferSize;
CheckPointAfter = checkPointAfter.Value;
MinCheckPointCount = minCheckPointCount;
MaxCheckPointCount = maxCheckPointCount;
CheckPointLowerBound = checkPointLowerBound;
CheckPointUpperBound = checkPointUpperBound;
MaxSubscriberCount = maxSubscriberCount;
NamedConsumerStrategy = namedConsumerStrategy;
ConsumerStrategyName = consumerStrategyName;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected override async Task Given() {

await Client.CreateToAllAsync(Group,
new PersistentSubscriptionSettings(
minCheckPointCount: 5,
checkPointLowerBound: 5,
checkPointAfter: TimeSpan.FromSeconds(1),
startFrom: Position.Start),
TestCredentials.Root);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected override async Task Given() {
await Client.CreateToAllAsync(Group,
StreamFilter.Prefix("test"),
new PersistentSubscriptionSettings(
minCheckPointCount: 5,
checkPointLowerBound: 5,
checkPointAfter: TimeSpan.FromSeconds(1),
startFrom: Position.Start),
TestCredentials.Root);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ protected override async Task Given() {
await Client.CreateToAllAsync(Group,
StreamFilter.Prefix("test"),
new PersistentSubscriptionSettings(
minCheckPointCount: 5,
checkPointLowerBound: 5,
checkPointAfter: TimeSpan.FromSeconds(1),
startFrom: Position.Start),
TestCredentials.Root);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected override async Task Given() {

await Client.CreateAsync(Stream, Group,
new PersistentSubscriptionSettings(
minCheckPointCount: 5,
checkPointLowerBound: 5,
checkPointAfter: TimeSpan.FromSeconds(1),
startFrom: StreamPosition.Start),
TestCredentials.Root);
Expand Down

0 comments on commit 1b5e6d1

Please sign in to comment.