Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

first cut at zinger rewrite as a kafka syncer #17

Merged
merged 10 commits into from
Sep 27, 2021
Merged

first cut at zinger rewrite as a kafka syncer #17

merged 10 commits into from
Sep 27, 2021

Conversation

mccanne
Copy link
Collaborator

@mccanne mccanne commented Sep 26, 2021

No description provided.

}

type Credentials struct {
User string
Password string
}

const HostEnv = "ZED_LAKE_HOST"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use HostEnv from zed/cmd/zed/api/command.go?

Copy link
Collaborator Author

@mccanne mccanne Sep 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I copied this from there, but importing would bring in a bunch of stuff that isn't used. If we wanted to do this, we should move to this logic to zed/cli/hostflags

}

func (p *Producer) Run(ctx context.Context, reader zio.Reader) error {
fmt.Printf("producing messages to topic %q...\n", p.topic)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should a library package be printing to stdout?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now, the entirety of the zinger package is a CLI tool so I vote to fix this later.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made issue #21

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
fifo/from.go Outdated Show resolved Hide resolved
fifo/from.go Outdated Show resolved Hide resolved
schema_registry.json Outdated Show resolved Hide resolved
kafka_config.json Outdated Show resolved Hide resolved
fifo/to.go Outdated Show resolved Hide resolved
cli/flags.go Outdated Show resolved Hide resolved
cmd/zinger/consume/command.go Outdated Show resolved Hide resolved
fifo/from.go Outdated
return ncommit, nrec, nil
}

// AdjustOffsetsAndShape runs a local Zed program to adjust the kafka offset fields
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// AdjustOffsetsAndShape runs a local Zed program to adjust the kafka offset fields
// AdjustOffsetsAndShape runs a local Zed program to adjust the Kafka offset fields

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it

fifo/producer.go Outdated Show resolved Hide resolved
fifo/producer.go Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
fifo/from.go Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated
> Note that `zinger sync from` does not currently support multiplexing multiple
> inbound topics, but support for this is straightforward and we will add it soon.
>
> We also need to adapt `sync from` so it updates te consumer commit offsets,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> We also need to adapt `sync from` so it updates te consumer commit offsets,
> We also need to adapt `sync from` so it updates the consumer commit offsets,

fifo/from.go Outdated
}
// This shouldn't happen since the consumer automatically adds
// this field.
return nil, fmt.Errorf("value read from Kafka topic missing kafka metadata field: %s", s)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return nil, fmt.Errorf("value read from Kafka topic missing kafka metadata field: %s", s)
return nil, fmt.Errorf("value read from Kafka topic missing 'kafka' metadata field: %s", s)

fifo/from.go Outdated
// This should not happen.
err = fmt.Errorf("[ERR! %w]", err)
}
return nil, fmt.Errorf("kafka meta-data field is missing 'offset' field: %s", s)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return nil, fmt.Errorf("kafka meta-data field is missing 'offset' field: %s", s)
return nil, fmt.Errorf("'kafka' metadata field is missing 'offset' field: %s", s)

README.md Outdated
`zinger` is a connector between Kafka topics and Zed lakes.
It can run in either direction: syncing a Zed lake to a Kafka topic or
syncing a Kafka topic to a Zed lake.
zinger` is a connector between [Kafka](https://kafka.apache.org/) and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
zinger` is a connector between [Kafka](https://kafka.apache.org/) and
`zinger` is a connector between [Kafka](https://kafka.apache.org/) and

@mccanne mccanne merged commit 1cb3dde into main Sep 27, 2021
@mccanne mccanne deleted the version-0 branch September 27, 2021 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants