Skip to content

Commit

Permalink
fix folder and update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sauljabin committed Jan 17, 2025
1 parent 584495a commit af84329
Show file tree
Hide file tree
Showing 16 changed files with 31 additions and 21 deletions.
26 changes: 18 additions & 8 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,42 +185,52 @@ kaskade consumer -b localhost:19092 --from-beginning -k string -v double -t doub
kaskade consumer -b localhost:19092 --from-beginning -k string -v boolean -t boolean
```

Test json consumer with Schema Registry (Confluent and Redpanda):

```bash
kaskade consumer -b localhost:19092 --from-beginning -t json-schema \
-k string -v registry \
--registry url=http://localhost:18081
```

Test json consumer without Schema Registry:

```bash
kaskade consumer -b localhost:19092 --from-beginning -k string -v json -t json
```

Test consumer with Schema Registry (Confluent and Redpanda):
Test avro consumer with Schema Registry (Confluent and Redpanda):

```bash
kaskade consumer -b localhost:19092 --from-beginning -t avro \
kaskade consumer -b localhost:19092 --from-beginning -t avro-schema \
-k string -v registry \
--registry url=http://localhost:18081
```

Test consumer with Apicurio Registry:
Test avro consumer with Apicurio Registry:

```bash
kaskade consumer -b localhost:19092 --from-beginning -t avro \
kaskade consumer -b localhost:19092 --from-beginning -t avro-schema \
-k string -v registry \
--registry url=http://localhost:18081/apis/ccompat/v7
```

Test consumer avro without Schema Registry:
Test avro consumer without Schema Registry:

```bash
kaskade consumer -b localhost:19092 --from-beginning -t avro \
-k string -v avro \
--avro value=tests/avro/user.avsc
--avro value=tests/avro_model/user.avsc
```

Test consumer with protobuf:
Test protobuf consumer:

> Install `protoc` with `brew install protobuf`.\
> Update descriptor with `python -m scripts.protobuf`.
```bash
kaskade consumer -b localhost:19092 --from-beginning -t protobuf \
-k string -v protobuf \
--protobuf descriptor=tests/protobuf/user.desc \
--protobuf descriptor=tests/protobuf_model/user.desc \
--protobuf value=User
```
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/protobuf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


def main() -> None:
path = "tests/protobuf"
path = "tests/protobuf_model"
commands = {
"build protobuf examples": f"protoc --include_imports --proto_path={path} --python_out={path} --pyi_out={path} --descriptor_set_out={path}/user.desc {path}/user.proto",
}
Expand Down
10 changes: 5 additions & 5 deletions scripts/sandbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
from faker import Faker

from kaskade.utils import pack_bytes, file_to_str, py_to_avro
from tests.protobuf.user_pb2 import User as ProtobufUser
from tests.avro.user import User as AvroUser
from tests.json.user import User as JsonUser
from tests.protobuf_model.user_pb2 import User as ProtobufUser
from tests.avro_model.user import User as AvroUser
from tests.json_model.user import User as JsonUser

JSON_USER_SCHEMA = "tests/json/user.schema.json"
AVRO_USER_SCHEMA = "tests/avro/user.avsc"
JSON_USER_SCHEMA = "tests/json_model/user.schema.json"
AVRO_USER_SCHEMA = "tests/avro_model/user.avsc"


class Populator:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions tests/tests_deserializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@
)
from kaskade.utils import file_to_str, py_to_avro
from tests import faker
from tests.protobuf.user_pb2 import User
from tests.protobuf_model.user_pb2 import User


CURRENT_PATH = os.getcwd()
DESCRIPTOR_NAME = "protobuf/user.desc"
DESCRIPTOR_NAME = "protobuf_model/user.desc"
DESCRIPTOR_PATH = (
f"{CURRENT_PATH}/{DESCRIPTOR_NAME}"
if CURRENT_PATH.endswith("tests")
else f"{CURRENT_PATH}/tests/{DESCRIPTOR_NAME}"
)

AVRO_SCHEMA_NAME = "avro/user.avsc"
AVRO_SCHEMA_NAME = "avro_model/user.avsc"
AVRO_PATH = (
f"{CURRENT_PATH}/{AVRO_SCHEMA_NAME}"
if CURRENT_PATH.endswith("tests")
Expand Down

0 comments on commit af84329

Please sign in to comment.