This is summary of my GSoC project with Jboss by Red hat. In this gist i have included some of the major features i implemented during the programe.
-
Project Repo : https://github.com/strimzi/amqp-kafka-bridge
Strimzi is a project about running Apache Kafka on platforms like kubernetes and openshift. It contains two main modules.
- Strimzi-Kafka-operator
- AMQP-Kafka-bridge.
The project idea for GSoC was to add HTTP support to the bridge so that it can listen to http clients and bridge them to Kafka.
The first challege was to design an architecture for HTTP and kafka interactions. At that time bridge supported AMQP and Both protocols have many key differences which definately reflected on the architecture. Some of the key differences were :
Architecture : https://docs.google.com/document/d/1eLVzzYaVL6eABs64iNFkfy7lcz2Or3act5LquPIGaE0/edit?usp=sharing
I used Vert.xHttpServer library to create a Http Server. Here the major part was to distinguish between incoming requests and map them to various corresponding operations on kafka. such as produce
,creation of consumer
, subscription
, consuming
, deleting consumer instances
etc.
-
initial commit for Http server implementation : https://github.com/strimzi/amqp-kafka-bridge/pull/100/commits/84a3e6ee7d6372c10586c1f15dba899b3fddbe21
Producer part is strongly related KafkaProducers
which produces messages to kafka server. some key features:
Producer PR : https://github.com/strimzi/amqp-kafka-bridge/pull/100/commits/0d5ae1eb119b9eb4f4e14dafc1455b3e7cc9e6a6 In this commit, I implemented the following features/commits :
The consumer API is about fetching records from kafka. HTTP clients can use consumer api in order to create consumers, manage subscriptions, manage offsets and consuming records. Some key features :
Consumer PR : https://github.com/strimzi/amqp-kafka-bridge/pull/100/commits/958f5aa0aea1f4b8ec27c5ec61dc42c962165cc8 In this commit i implemented following features.
-
Changed "adhoc" calls to sink.() to single sink.handle() : https://github.com/shubhamvashisht/amqp-kafka-bridge/commit/c9b285862bf8a2b59071870c69dd152f8bd600a7
-
Fixed endpoint map for producer : https://github.com/shubhamvashisht/amqp-kafka-bridge/commit/5f28cc5f86bff8f09fc7c278b64f1dda25d24e8c
-
added consumer deletion upon client request : https://github.com/shubhamvashisht/amqp-kafka-bridge/commit/ec73a6faed54831b3c28c2a81f35d3bb02108001
-
fixed commit offset handler : https://github.com/shubhamvashisht/amqp-kafka-bridge/commit/d2d2f5d9b5361c4d38c27e65e1bd4457b8ed257d
-
added doc for consumer API : https://github.com/shubhamvashisht/amqp-kafka-bridge/commit/2085ea58d882abb94d81a7ec4904bd342cdf33e8
-
fixed NPE while deleting consumer : https://github.com/shubhamvashisht/amqp-kafka-bridge/commit/a88d32655f1d4f1f5f31a29950299992dfa06d9d
-
changed baseUri String with BRIDGE_HOST and BRIDGE_PORT : https://github.com/shubhamvashisht/amqp-kafka-bridge/commit/d22f5340bc11ab3da7336c214c609bfdd5607ac7
-
fixed and handled cases when conusme,commit fails : https://github.com/shubhamvashisht/amqp-kafka-bridge/commit/1254b0841df8a756c3582890c5d383210d21b1ca
-
added test for consumer and fixed partitionAssignHandler : https://github.com/shubhamvashisht/amqp-kafka-bridge/commit/1e1bf1bed0b7dfa7619ca63c9cde3845c7f07caa
-
-
added consumer test for receiving message from partition and offset : https://github.com/shubhamvashisht/amqp-kafka-bridge/commit/e7b776b7440f092f394b34bc8362e8f1a2108658
-
-
-
added consumer deletion test : https://github.com/shubhamvashisht/amqp-kafka-bridge/commit/bc058b194815fa786d0a6728f246a3c42a774c2a
-