Open smartpcr opened 2 years ago
hub initialized with connectionString and filePersister
ctx := context.Background() fp, err := persist.NewFilePersister(persistDir) if err != nil { fmt.Println(err.Error()) os.Exit(1) } hub, err := eventhub.NewHubFromConnectionString(connStr, eventhub.HubWithOffsetPersistence(output)) if err != nil { fmt.Println(err.Error()) os.Exit(1) } defer hub.Close(ctx) runtimeInfo, err := hub.GetRuntimeInformation(ctx) if err != nil { fmt.Println(err.Error()) os.Exit(1) } partitionIds := runtimeInfo.PartitionIDs consumerGroup := os.Getenv("EVENTHUB_CONSUMERGROUP") if consumerGroup == "" { consumerGroup = "$Default" } for _, partitionId := range partitionIds { _, err = hub.Receive(ctx, partitionId, output.HandleEvent, eventhub.ReceiveWithConsumerGroup(consumerGroup), eventhub.ReceiveWithPrefetchCount(20000)) if err != nil { fmt.Println(err.Error()) os.Exit(1) } }
should be able to create new file instead of throwing error
when file doesn't exist, it returns NewCheckpointFromStartOfStream(), err but err is not nil, and caused receive to fail here
NewCheckpointFromStartOfStream(), err
@smartpcr Did you find a solution to this issue? Or how did you go about creating the file if it doesn't exist?
hub initialized with connectionString and filePersister
Expected Behavior
should be able to create new file instead of throwing error
Actual Behavior
when file doesn't exist, it returns
NewCheckpointFromStartOfStream(), err
but err is not nil, and caused receive to fail hereEnvironment