{"repo":"sarkarshuvojit/kafka-sync-proxy","free":true,"listed":false,"github":"https://github.com/sarkarshuvojit/kafka-sync-proxy","clone":"git clone https://github.com/sarkarshuvojit/kafka-sync-proxy.git","description":"Make http calls to Kafka that waits for responses.","language":"Go","stars":16,"topics":["golang","kafka","kafka-producer","kafka-consumer","microservices","request-reply"],"license":"MIT","category":"data-pipelines","readme_excerpt":"Kafka Synchronous Proxy A web service to make traditional rest api calls which publishes a messsage into a topic & wait for the response in a response channel. How does it work? The following steps are followed - Create a random string to be passed as key (currently done using uuidv4) - Prepare a kafka message containing the key , payload as the value and headers as is. - Produce it to the requestTopic - Consume from the responseTopic until a message with the exact key is received - If nothing is received in REQ TIMEOUT seconds then the circuit breaks and HTTP 408 Request Timeout is sent back. Note: Currently, REQ TIMEOUT is set to 5s. Installation Go Install from pkg.go.dev Docker Run docker image. Usage/Examples Running It can be run as a standalone as well as inside a docker container. standalone After installing from pkg.go.dev docker docker-compose Use it with docker-compose Calling the API There is only route hosted at /v1/ which only listens to POST Let's say you have a microservice listening to com.org.events.testInitiated which processes the message and responds to the com.org.events.testCompleted you can possibly test it by the following curl request. Should respond with: Note: This system requires that the response sends the message with the same key that was sent. License MIT","default_branch":null,"files":null,"tree":[],"storefront":"/r/sarkarshuvojit","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/sarkarshuvojit/kafka-sync-proxy/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}