Class EntityFrameworkKafkaOffsetStore
Stores the latest consumed offsets in EntityFramework.
Implements
Inherited Members
Namespace: Silverback.Messaging.Consuming.KafkaOffsetStore
Assembly: Silverback.Storage.EntityFramework.dll
Syntax
public class EntityFrameworkKafkaOffsetStore : IKafkaOffsetStore
Constructors
EntityFrameworkKafkaOffsetStore(EntityFrameworkKafkaOffsetStoreSettings, IServiceScopeFactory)
Initializes a new instance of the EntityFrameworkKafkaOffsetStore class.
Declaration
public EntityFrameworkKafkaOffsetStore(EntityFrameworkKafkaOffsetStoreSettings settings, IServiceScopeFactory serviceScopeFactory)
Parameters
| Type | Name | Description |
|---|---|---|
| EntityFrameworkKafkaOffsetStoreSettings | settings | The offset store settings. |
| IServiceScopeFactory | serviceScopeFactory | The IServiceScopeFactory. |
Methods
GetStoredOffsets(string)
Returns the stored offsets for the specified consumer group.
Declaration
public IReadOnlyCollection<KafkaOffset> GetStoredOffsets(string groupId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | groupId | The consumer group id. |
Returns
| Type | Description |
|---|---|
| IReadOnlyCollection<KafkaOffset> | The collection of KafkaOffset that have been stored. |
StoreOffsetsAsync(string, IEnumerable<KafkaOffset>, ISilverbackContext?)
Stores the specified offsets.
Declaration
public Task StoreOffsetsAsync(string groupId, IEnumerable<KafkaOffset> offsets, ISilverbackContext? context = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | groupId | The consumer group id. |
| IEnumerable<KafkaOffset> | offsets | The offsets. |
| ISilverbackContext | context | The ISilverbackContext. |
Returns
| Type | Description |
|---|---|
| Task | A Task representing the asynchronous operation. |