diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 59f44e6..ef649f2 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,6 +1,6 @@ --- name: Feature Request -about: Suggest a new feature or improvement for the Python SDK for Zerobus. +about: Suggest a new feature or improvement for the Java SDK for Zerobus. title: "[FEATURE] " labels: '' assignees: '' diff --git a/.github/ISSUE_TEMPLATE/issue.md b/.github/ISSUE_TEMPLATE/issue.md index a16ca54..7882e77 100644 --- a/.github/ISSUE_TEMPLATE/issue.md +++ b/.github/ISSUE_TEMPLATE/issue.md @@ -1,6 +1,6 @@ --- name: SDK Issue -about: Use this to report an issue with the Python SDK for Zerobus. +about: Use this to report an issue with the Java SDK for Zerobus. title: "[ISSUE] " labels: '' assignees: '' diff --git a/README.md b/README.md index 261e177..2b03c7d 100644 --- a/README.md +++ b/README.md @@ -147,7 +147,56 @@ dependencies { } ``` -Maven and Gradle will automatically download the SDK and all its dependencies (gRPC, protobuf, etc.). +**Important**: You must also add the required dependencies manually, as they are not automatically included: + +```xml + + + + + com.databricks + zerobus-ingest-sdk + 0.1.0 + + + + + com.google.protobuf + protobuf-java + 3.24.0 + + + io.grpc + grpc-netty-shaded + 1.58.0 + + + io.grpc + grpc-protobuf + 1.58.0 + + + io.grpc + grpc-stub + 1.58.0 + + + org.slf4j + slf4j-api + 1.7.36 + + + org.slf4j + slf4j-simple + 1.7.36 + + + javax.annotation + javax.annotation-api + 1.3.2 + + +``` **Fat JAR (with all dependencies bundled):** @@ -236,35 +285,15 @@ Create `pom.xml`: zerobus-ingest-sdk 0.1.0 - - - - - - org.xolstice.maven.plugins - protobuf-maven-plugin - 0.6.1 - - com.google.protobuf:protoc:3.24.0:exe:${os.detected.classifier} - - - - - compile - - - - - - - - kr.motd.maven - os-maven-plugin - 1.7.1 - - - + + + com.google.protobuf + protobuf-java + 3.24.0 + + + ``` @@ -302,6 +331,8 @@ protoc --java_out=src/main/java src/main/proto/record.proto This generates `src/main/java/com/example/proto/Record.java`. +**Note**: Ensure you have `protoc` version 24.4 installed. [Download protoc](https://github.com/protocolbuffers/protobuf/releases/tag/v24.4) if needed. The generated Java files are compatible with `protobuf-java` 3.24.0. + ### Generate Protocol Buffer Schema from Unity Catalog (Alternative) Instead of manually writing and compiling your protobuf schema, you can automatically generate it from an existing Unity Catalog table schema using the included `GenerateProto` tool. @@ -465,17 +496,21 @@ public class ZerobusClient { **Using Maven:** ```bash -# Compile protobuf and Java code -mvn compile +# First, compile the proto file to generate Java classes +protoc --java_out=src/main/java src/main/proto/record.proto -# Run your application +# Compile and run +mvn compile mvn exec:java -Dexec.mainClass="com.example.ZerobusClient" ``` -**Or build and run as JAR:** +**Or build as standalone JAR:** ```bash -# Package into JAR +# Generate proto classes +protoc --java_out=src/main/java src/main/proto/record.proto + +# Package into executable JAR (add maven-shade-plugin to pom.xml) mvn package # Run the JAR @@ -485,6 +520,9 @@ java -jar target/my-zerobus-app-1.0-SNAPSHOT.jar **Using downloaded JAR (without Maven):** ```bash +# Generate proto classes +protoc --java_out=src/main/java src/main/proto/record.proto + # Compile javac -cp "lib/*" -d out src/main/java/com/example/ZerobusClient.java src/main/java/com/example/proto/Record.java