Skip to content

eventhub.Receive function gives no such file or directory instead of creating one  #280

Open
@sariburak

Description

Setup

I first create a FilePersister and Hub by the following code:

persister, err := persist.NewFilePersister(output)
if err != nil {
	// error handle
}
hub, err := eventhub.NewHubFromConnectionString(conn_str, eventhub.HubWithOffsetPersistence(persister))
if err != nil {
	//error handle
}
t.hub = hub

and then try to fetch data from EventHub like this:

for _, partitionID := range partitionIDs {
    _, err := t.hub.Receive(ctx, partitionID, handler, eventhub.ReceiveWithConsumerGroup('$Default'))
    if err != nil {
        // err handle
    }
}

However. hub.Receive gives no such file or directory error.

Expected Behavior

FilePersister file should be automatically created.

Actual Behavior

gives no such file or directory error.

Environment

  • OS: macOS Ventura
  • Go version: go version go1.19.1 darwin/arm64
  • Version of Library: 3.3.20

Additional Notes

I tried to run the code in a docker container. I built the code and copied the binary into a docker container which is running on golang:alpine. In that case, code run without any problems. So that's interesting.

Also, in my local run, I am sure the output dir has all the permission it needs.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions