While working with Apache Kafka and Confluent Schema Registry, I often spend time switching between tools like
- kcat (formerly kafkacat)
- the Kafka Avro console consumer/producer
- the Kafka JSON Schema console consumer/producer
- the Kafka Protobuf console consumer/producer
- the Schema Registry Maven plugin
Recently I decided to combine much of the functionality of the above tools into a single tool called kgiraffe, which is sort of a companion to kcat. While kcat excels at the command line, kgiraffe exposes its functionality with a GraphQL interface. In addition, kgiraffe fully supports topics using Avro, JSON Schema, and Protobuf schemas. kgiraffe provides the following features for managing both topics and schemas out of the box:
- Topic Management
- Query topics
- Publish to topics
- Subscribe to topics
- Full support for Avro, JSON Schema, and Protobuf records
- Schema Management
- Validate and stage schemas
- Test schema compatibility
- Query schemas and subjects
- Register schemas
Before kgiraffe starts, you indicate which schemas are associated with which topics. Based on the specified schemas, kgiraffe will automatically generate a GraphQL schema that can be used to read, write, and subscribe to your topics. kgiraffe also allows you to validate and stage schemas, as well as test them for compatibility, before you register them to Schema Registry.
After downloading a release, starting kgiraffe is as easy as
$ bin/kgiraffe -b mybroker -t mytopic -r http://schema-registry-url:8081
Once kgiraffe is running, browse to http://localhost:8765/kgiraffe to launch the GraphQL Playground.
Example GraphQL queries can be found at the README.
If you find yourself bouncing between tools while working with Kafka and Schema Registry, please give kgiraffe a try and let me know what you think.