Class KEFCoreTopicRetentionAttribute
- Namespace
- MASES.EntityFrameworkCore.KNet.Metadata
- Assembly
- MASES.EntityFrameworkCore.KNet.dll
Overrides the retention policy for the Kafka topic associated with this entity type. Applied at topic creation time (EnsureCreated()).
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public sealed class KEFCoreTopicRetentionAttribute : Attribute
- Inheritance
-
KEFCoreTopicRetentionAttribute
- Inherited Members
Remarks
At least one of RetentionBytes or RetentionMs must be specified.
Use -1 to leave the respective setting at its cluster default.
Constructors
KEFCoreTopicRetentionAttribute(long, long)
Initializes a new instance of KEFCoreTopicRetentionAttribute.
public KEFCoreTopicRetentionAttribute(long retentionBytes = -1, long retentionMs = -1)
Parameters
retentionByteslongMaximum size in bytes the topic will retain before deleting older segments. Use
-1to leave this setting at its cluster default (unlimited).retentionMslongMaximum time in milliseconds records are retained before they are eligible for deletion. Use
-1to leave this setting at its cluster default (unlimited).
Properties
RetentionBytes
Maximum size in bytes the topic will retain before deleting older segments.
-1 means the cluster default applies.
public long RetentionBytes { get; }
Property Value
RetentionMs
Maximum time in milliseconds records are retained before they are eligible for deletion.
-1 means the cluster default applies.
public long RetentionMs { get; }