-
Notifications
You must be signed in to change notification settings - Fork 78
Kafka Replicator Source & Quix Environment Source #448
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
Merged
Merged
Changes from 11 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
8de7387
Kafka source
ovv 5b5825d
fixup
ovv faead71
fixup
ovv 8d90da7
cleanup
ovv 36d8c48
documentation
ovv 71d151a
token documentation
ovv 19b7534
docstring fix
ovv a9c3397
review comments
ovv 086c446
review comments
ovv 17b80c4
kafka replicator source
ovv 7776359
Apply suggestions from code review
ovv 54e427a
review comments
ovv 360859b
source consumer group
ovv c90831e
Update quixstreams/sources/kafka/kafka.py
daniil-quix 805a0ac
lint
ovv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Kafka Replicator Source | ||
|
||
A source that reads data from a Kafka topic and produce it to another Kafka topic. The two topics can be located on different Kafka clusters. | ||
|
||
This source supports exactly-once guarantees. | ||
|
||
## How to use the Kafka Replicator Source | ||
|
||
To use a Kafka Replicator source, you need to create an instance of `KafkaReplicatorSource` and pass it to the `app.dataframe()` method. | ||
|
||
```python | ||
from quixstreams import Application | ||
from quixstreams.sources import KafkaReplicatorSource | ||
|
||
def main(): | ||
app = Application() | ||
source = KafkaReplicatorSource( | ||
name="my-source", | ||
app_config=app.config, | ||
topic="source-topic", | ||
broker_address="source-broker-address" | ||
) | ||
|
||
sdf = app.dataframe(source=source) | ||
sdf.print(metadata=True) | ||
|
||
app.run(sdf) | ||
|
||
if __name__ == "__main__": | ||
main() | ||
``` | ||
|
||
## Topic | ||
|
||
The Kafka Replicator source only deals with bytes. It reads the remote keys and values as bytes and produces them directly as bytes. | ||
You can configure the key and value deserializer used by the Streaming Dataframe with the `key_deserializer` and `value_deserializer` paramaters. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Quix Environment Source | ||
|
||
A specialised [Kafka Source](kafka-source.md) that simplify copying data from a Quix environment. | ||
|
||
## How to use the Quix Environment Source | ||
|
||
To use a Quix Environment source, you need to create an instance of `QuixEnvironmentSource` and pass it to the `app.dataframe()` method. | ||
|
||
```python | ||
from quixstreams import Application | ||
from quixstreams.sources import QuixEnvironmentSource | ||
|
||
def main(): | ||
app = Application() | ||
source = QuixEnvironmentSource( | ||
name="my-source", | ||
app_config=app.config, | ||
topic="source-topic", | ||
quix_sdk_token="quix-sdk-token", | ||
quix_workspace_id="quix-workspace-id", | ||
) | ||
|
||
sdf = app.dataframe(source=source) | ||
sdf.print(metadata=True) | ||
|
||
app.run(sdf) | ||
|
||
if __name__ == "__main__": | ||
main() | ||
``` | ||
|
||
## Token | ||
|
||
The Quix Environment Source requires the sdk token of the source environment. [Click here](../../../develop/authentication/streaming-token.md) for more information on SDK tokens. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
from .checkpoint import Checkpoint | ||
from .checkpoint import Checkpoint, BaseCheckpoint | ||
from .exceptions import InvalidStoredOffset |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from .kafka import * | ||
from .quix import * |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.