Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/instaclustr/groovy-kafka-protobuf-example
Groovy+Kafka+Protobuf Example
https://github.com/instaclustr/groovy-kafka-protobuf-example
netapp-public
Last synced: 4 days ago
JSON representation
Groovy+Kafka+Protobuf Example
- Host: GitHub
- URL: https://github.com/instaclustr/groovy-kafka-protobuf-example
- Owner: instaclustr
- Created: 2019-12-06T01:11:10.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-10-04T23:56:39.000Z (about 2 years ago)
- Last Synced: 2024-03-26T20:25:55.401Z (8 months ago)
- Topics: netapp-public
- Language: Groovy
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.adoc
Awesome Lists containing this project
README
= Groovy+Kafka+Protobuf Example
This repository contains an example Kafka _consumer_ and _producer_ written in Groovy that handle
Protobuf encoded messages.== Usage
1. Compile the .proto files into a JAR:
+
----
cd proto && mvn package
----
+
This will output `proto/target/proto-0.1.1-SNAPSHOT.jar`2. Run the consumer Groovy script:
+
----
groovy -cp proto/target/proto-0.1.1-SNAPSHOT.jar groovy/src/consumer.groovy
----3. Run the producer Groovy script:
+
----
groovy -cp proto/target/proto-0.1.1-SNAPSHOT.jar groovy/src/producer.groovy "Hello World"
----If everything works correctly you should see `message` field from the `ExampleMessage` Protobuf displayed by the consumer:
----
groovy -cp proto/target/proto-0.1.1-SNAPSHOT.jar groovy/src/groovy/consumer.groovy
got message: Hello World
----