Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align persistent subscription names with RFC #198

Merged
merged 1 commit into from
Feb 15, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ class Program
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 @@ partial class EventStorePersistentSubscriptionsClient {
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 partial class EventStorePersistentSubscriptionsClient {
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 sealed class PersistentSubscriptionSettings {
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 @@ public class Fixture : EventStoreClientFixture {

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 @@ public class Fixture : EventStoreClientFixture {
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 @@ public class Fixture : EventStoreClientFixture {
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 @@ public class Fixture : EventStoreClientFixture {

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