kafkid

command module
v0.0.0-...-c02a6a4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2024 License: MIT Imports: 1 Imported by: 0

README

🚅 Kafkid - Kafka Messaging Service

This project provides a simple messaging service that allows publishing and consuming messages through Kafka. It includes an API for message publishing and a consumer for message consumption.

Feature

  • Publish messages to Kafka through a simple API.
  • Consume messages from Kafka using a consumer.
  • Configurable settings for Kafka connection and topics.

Prerequisites

Make sure you have the following installed before setting up and running the messaging service:

  • Kafka
  • Zookeeper

This project provides zk-single-kafka-single.yaml you can run this command to easy setup Kafka and Zookeeper using docker

docker-compose -f zk-single-kafka-single.yaml up -d

Getting Started

Configuration

Copy config.sample.yaml to config.yaml and modify based on your needs.

Download Package
make install
Usage
Run Producer Service
make build
./bin/kafkid producer

Producer

Publishing Message

To publish a message to Kafka, use the provided API. Replace the placeholder values with your actual data.

POST http://localhost:8123/v1/publish
{
    "topic": "notification",
    "message": {
        "test": "oke",
        "isEnabled": 1
    }
    // "message": "you can send any type of message"
}
Run Consumer Service
make build
./bin/kafkid consumer --topics=topic1,topic2

After you ran this command, the consumed message will be printed in console log Consumer

Contributing

Contributions are welcome! Please follow the Contribution Guidelines.

License

This project is licensed under the MIT License.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
pkg/validator/mocks
Code generated by MockGen.
Code generated by MockGen.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL