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

support avro output for kafka #69

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,406 changes: 4,406 additions & 0 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,10 @@ bytes = "1.0"
configparser = "3.0.2"
async-mutex = "1.4.0"
project-root = "0.2.2"
strum = { version = "0.24.1", features = ["derive"] }
strum = { version = "0.25.0", features = ["derive"] }
regex = "1.5.4"
rdkafka = {version = "0.34.0", features = ["libz-static"] }
# rdkafka = "0.34.0"
kafka = "0.9.0"
kafka = "0.10.0"
reqwest = "0.11.16"
rusoto_core = "0.48.0"
rusoto_sqs = "0.48.0"
Expand All @@ -56,4 +55,5 @@ mongodb = { version = "2.5.0" }
dotenv = "0.15.0"
redis = { version = "0.23.1", features = ["tokio-comp"] }
thiserror = "1.0.44"
async-std = "1.12.0"
async-std = "1.12.0"
apache-avro = { version = "0.16.0", features = ["derive"]}
19 changes: 11 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# ARG DIST_IMG=gcr.io/distroless/cc:nonroot
# ARG DIST_IMG=gcr.io/distroless/cc:debug
ARG DIST_IMG=gcr.io/distroless/cc-debian12:debug
# ARG DIST_IMG=debian:buster-slim
ARG DIST_IMG=gcr.io/distroless/cc:debug

ARG RUST_VERSION=1.70.0
ARG RUST_VERSION=1.69.0
# ARG RUST_IMG_ALT=-slim-bullseye
# ARG RUST_IMG_ALT=-bullseye
ARG RUST_IMG_ALT=-bookworm
ARG RUST_IMG_ALT=-bullseye

FROM --platform=${BUILDPLATFORM} rust:${RUST_VERSION}${RUST_IMG_ALT} as builder

Expand Down Expand Up @@ -36,8 +33,7 @@ RUN --mount=type=cache,target=$CARGO_HOME/git,rw \
# apt install --no-install-recommends -y \
# pkg-config \
# libssl-dev \
# libcrypto++-dev \
# zlib1g
# libcrypto++-dev

WORKDIR /app
COPY . ./
Expand All @@ -46,6 +42,13 @@ COPY . ./
# --mount=type=cache,target=$CARGO_HOME/registry,rw \
# cargo update

# RUN --mount=type=cache,target=$CARGO_HOME/git,rw \
# --mount=type=cache,target=$CARGO_HOME/registry,rw \
# --mount=type=cache,target=/app/target,rw \
# cargo build --release ${BUILD_ARGS} && \
# mkdir -p bin/ && \
# cp /app/target/release/${MODULE_NAME} bin/

RUN --mount=type=cache,target=$CARGO_HOME/git,rw \
--mount=type=cache,target=$CARGO_HOME/registry,rw \
--mount=type=cache,target=/app/target,rw \
Expand Down
3 changes: 2 additions & 1 deletion dt-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ regex = { workspace = true }
nom = { workspace = true }
tokio = { workspace = true }
thiserror = { workspace = true }
kafka = { workspace = true }
kafka = { workspace = true }
apache-avro = {workspace = true}
6 changes: 6 additions & 0 deletions dt-common/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,10 @@ pub enum Error {

#[error("kafka error: {0}")]
KafkaError(#[from] kafka::Error),

#[error("avro encode error: {0}")]
AvroEncodeError(#[from] apache_avro::Error),

#[error("enum parse error: {0}")]
EnumParseError(#[from] strum::ParseError),
}
3 changes: 2 additions & 1 deletion dt-connector/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ log4rs = { workspace = true }
redis = { workspace = true }
thiserror = { workspace = true }
async-std = { workspace = true }
chrono = { workspace = true }
chrono = { workspace = true }
apache-avro = {workspace = true}
Loading
Loading