apige/kafka-node-inventory-update-for-oms-by-companyid-channelid

By apige

Updated about 2 years ago

Kafka case studies for order management systems: updating inventory/stock

Image
Message queues
Web servers
Databases & storage
0

253

apige/kafka-node-inventory-update-for-oms-by-companyid-channelid repository overview

Sure, here's a rewritten overview for your Docker Hub repository:


Kafka Node Inventory Update for OMS by CompanyID ChannelID

This repository provides a robust, scalable, and efficient Kafka-based Node.js service designed to update inventory for an Order Management System (OMS) based on CompanyID and ChannelID. Leveraging Kafka for messaging ensures high throughput and reliability, making it ideal for large-scale, real-time inventory updates.

Features

  • Kafka Integration: Utilizes Kafka for high-performance, reliable message queuing and processing.
  • Node.js Service: Built using Node.js for efficient, non-blocking I/O operations.
  • Real-time Inventory Updates: Processes inventory updates in real-time, ensuring your OMS is always up-to-date.
  • Scalable and Resilient: Designed to handle large volumes of messages with built-in fault tolerance and scalability.
  • Configurable: Easily configure Kafka topics, brokers, and other parameters to fit your specific needs.

Why Use This Project?

  • High Performance: Designed for high throughput and low latency, ensuring quick processing of inventory updates.
  • Reliability: Kafka provides strong durability and fault tolerance, making sure no messages are lost.
  • Scalability: Easily scale the service horizontally to handle increasing loads.
  • Flexibility: Configure the service to work with different Kafka topics, brokers, and other settings.
  • Ease of Use: Simple setup and deployment with Docker, allowing for consistent development and production environments.

Architecture

The architecture consists of the following components:

  1. Kafka Broker: Manages the storage and transmission of messages.
  2. Node.js Service: Consumes messages from Kafka and updates the OMS inventory.
  3. Docker Compose: Manages the containerized environment, making it easy to set up and run the entire stack.

Setup Instructions

  1. Clone the repository:

    git clone https://github.com/yourusername/kafka-node-inventory-update-for-oms-by-companyid-channelid.git
    cd kafka-node-inventory-update-for-oms-by-companyid-channelid
    
  2. Build and start the Docker containers:

    docker-compose up -d --build
    

Configuration

Configuration is managed through environment variables and configuration files. You can set Kafka broker addresses, topics, and other relevant settings.

Example Environment Variables
KAFKA_BROKER=localhost:9092
KAFKA_TOPIC=inventory_updates
COMPANY_ID=your_company_id
CHANNEL_ID=your_channel_id

Running the Service

  1. Start the containers:

    docker-compose up -d --build
    
  2. Verify the service is running:

    Check the logs to ensure the service is running and connected to Kafka:

    docker-compose logs -f
    

API Usage

Inventory Update Message Format

Messages consumed from Kafka should be in the following format:

{
  "companyID": "your_company_id",
  "channelID": "your_channel_id",
  "inventoryUpdate": {
    "productID": "product_123",
    "quantity": 100
  }
}
Example Message
{
  "companyID": "company123",
  "channelID": "channel456",
  "inventoryUpdate": {
    "productID": "prod789",
    "quantity": 50
  }
}
Sending a Test Message

You can send a test message to Kafka using a Kafka producer or command-line tool:

kafka-console-producer --broker-list localhost:9092 --topic inventory_updates

Paste the example message and press Enter.

Troubleshooting

  • Kafka Connection Issues: Ensure Kafka is running and accessible from the Node.js service.
  • Environment Variables: Verify that all required environment variables are set correctly.
  • Logs: Check the Docker container logs for any error messages.

Tag summary

Content type

Image

Digest

sha256:ceaac241b

Size

43.2 MB

Last updated

about 2 years ago

docker pull apige/kafka-node-inventory-update-for-oms-by-companyid-channelid