Skip to content

Commit 51d45a2

Browse files
committed
feat(azure-plugin): configure Event Hub processor to read from earliest position
1 parent 4c6bb1c commit 51d45a2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

plugins/azure/main.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"sync"
1212
"time"
1313

14+
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
1415
"github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventhubs/v2"
1516
"github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventhubs/v2/checkpoints"
1617
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob"
@@ -237,7 +238,13 @@ func pull(group *config.ModuleGroup) {
237238
}
238239
defer client.Close(context.Background())
239240

240-
processor, err := azeventhubs.NewProcessor(client, checkpointStore, nil)
241+
processor, err := azeventhubs.NewProcessor(client, checkpointStore, &azeventhubs.ProcessorOptions{
242+
StartPositions: azeventhubs.StartPositions{
243+
Default: azeventhubs.StartPosition{
244+
Earliest: to.Ptr(true),
245+
},
246+
},
247+
})
241248
if err != nil {
242249
_ = catcher.Error("cannot create Event Hub processor", err, map[string]any{
243250
"group": agent.GroupName,

0 commit comments

Comments
 (0)