Skip to Content

Kafka Connector

by

80.29

16.0 0
Live Preview
Required Apps Discuss (mail)
Technical Name kafka_connector
License OPL-1
Also available in version 17.0 16.0 15.0 14.0
You bought this module and need support ? Click here!
Technical Name kafka_connector
License OPL-1
Also available in version v 17.0 v 16.0 v 15.0 v 14.0

Introduction

The "Kafka Connector" (technical name: kafka_connector) is an Odoo module designed for seamless integration with Apache Kafka, a distributed event streaming platform. This module allows Odoo to function as a consumer and producer of messages on a Kafka broker, facilitating real-time data exchange with other business applications and services. It is built for enterprise environments that require high performance and reliability for mission-critical applications.

Key Features

  • Real-time Message Processing: The module continuously consumes messages from configured Kafka topics, ensuring that Odoo business processes are updated in real-time.

  • Concurrent Processing: It supports the simultaneous execution of multiple operations in isolated processes, which improves resource utilization and allows for greater scalability.

  • Robust Error Handling: The connector includes configurable retry logic with exponential backoff and comprehensive error recovery mechanisms to ensure message delivery and processing.

  • Health Monitoring: It provides periodic health checks and detailed status reporting, which can be monitored via Odoo's logging system.

  • Comprehensive Message Logging: The module keeps a detailed audit trail and a complete history of all processed messages, which is essential for tracking and troubleshooting.

  • Smart Notifications: An intelligent notification system alerts administrators to potential issues with detailed error reports.

  • Bidirectional Communication: The module supports both consuming messages from Kafka and producing messages to Kafka, providing a true two-way integration.

  • Scalable Architecture: Designed with enterprise-grade reliability and scalability, it is suitable for high-volume data processing and mission-critical applications.

Compatibility & Technical Details

The module is compatible with Odoo versions 14.0 through 17.0. It requires the kafka-python library and depends on the standard Odoo Discuss app. The technical name is kafka_connector and it is licensed under the Odoo Proprietary License v1.0 (OPL-1).

Kafka

Kafka Connector

Enterprise-Grade Kafka Integration for Odoo 17

🚀 Real-time Message Processing

Seamlessly integrate Kafka message streams with your Odoo business processes. Built for enterprise scalability and reliability.

✨ Key Features

🔄

Real-time Consumption

Continuously consume messages from configured Kafka topics with high-performance streaming capabilities.

⚙️

Concurrent Processing

Executes multiple operations simultaneously in isolated processes, ensuring efficient resource usage and scalability.

🔧

Error Handling & Retry

Configurable retry logic with exponential backoff and comprehensive error recovery mechanisms.

📊

Health Monitoring

Periodic health checks with detailed status reporting and performance metrics tracking, output to the server console via Odoo's logging system.

📝

Message Logging

Comprehensive message tracking and audit trail with detailed processing history.

🔔

Smart Notifications

Intelligent notification system for administrators with detailed error reporting and alerts.

🏗️ Architecture Overview

100% Safe Concurrency
Scalable
24/7 Monitoring
0 Near-Zero Downtime

🚀 Quick Start

1. Install Dependencies

pip install kafka-python

2. Set DB Name (odoo.conf)

db_name = YOUR DB NAME

3. Configure Master Consumer

Navigate to Kafka Connector → Master Consumers

4. Monitoring Message Logs

Navigate to Kafka Connector → Message Logs

5. Set Target Model & Function

Example:

def consume_purchase_order(self, message):
    # Dummy method for simulation data
    vals = {
        'origin': message.get('order_ref'),
        'partner_id': message.get('vendor_name'),
        'order_line': [
            (0, 0, {
                'product_id': item.get('product'),
                'product_qty': item.get('qty'),
                'price_unit': item.get('price'),
            }) for item in message.get('items', [])
        ]
    }
    try:
        create_po = self.with_user(2).create(vals)
        return create_po
    except Exception as e:
        raise ValidationError(_(f'Failed to consume purchase order. Error: {e}'))

6. Start Consumer

To start the Kafka consumer, click the RUN button located in the Master Consumer form or from the Tree View panel.

7. Stop Consumer

To stop the Kafka consumer, click the STOP button located in the Master Consumer form or from the Tree View panel.

8. Produce Message

To send message to Kafka, just do like the following example:

from odoo import models, fields, api
from kafka import KafkaProducer
from json import dumps


class PoInherit(models.Model):
    _inherit = 'purchase.order'

    @api.model
    def create(self, values):
        producer = KafkaProducer(bootstrap_servers=['localhost:9092'],
                                 value_serializer=lambda x: dumps(x).encode('utf-8'))
        for rec in self:
            data = {
                'partner_id': rec.id
            }
            producer.send('po_odoo', value=data)
            producer.flush()

        return super(PoInherit, self).create(values)
                        

🛠️ Technology Stack

Python 3.10
Apache Kafka
kafka-python
JSON

🎯 Use Cases

📦

Order Processing

Real-time order updates from e-commerce platforms and external systems.

📊

Analytics & Reporting

Stream analytics data and generate real-time business intelligence reports.

🔄

System Integration

Seamless integration between multiple business systems and applications.

📱

IoT Data Processing

Process sensor data and IoT device messages in real-time for smart operations.

📸 Screenshots

Real-time Control Panel

Master Consumer Management

Configure and manage your Kafka consumer settings with an intuitive interface.

Real-time Control Panel

Message Processing Logs

Monitor all processed messages with detailed logs and status information.

Real-time Control Panel

Real-time Control Panel

Start, stop, and monitor your Kafka consumers with real-time status updates.

Performance Metrics

Performance Metrics

Track performance metrics, and error rates in real-time.

🏆 Enterprise Ready

Built with enterprise-grade reliability, scalability, and security in mind. Perfect for high-volume message processing and mission-critical applications.

High Performance Fault Tolerant Auto Recovery Monitoring

Kafka Connector for Odoo 17

Enterprise-grade message processing solution

For technical support, please contact us at Technical Support

Odoo Proprietary License v1.0
This software and associated files (the "Software") may only be used (executed,
modified, executed after modifications) if you have purchased a valid license
from the authors, typically via Odoo Apps, or if you have received a written
agreement from the authors of the Software (see the COPYRIGHT file).

You may develop Odoo modules that use the Software as a library (typically
by depending on it, importing it and using its resources), but without copying
any source code or material from the Software. You may distribute those
modules under the license of your choice, provided that this license is
compatible with the terms of the Odoo Proprietary License (For example:
LGPL, MIT, or proprietary licenses similar to this one).

It is forbidden to publish, distribute, sublicense, or sell copies of the Software
or modified copies of the Software.

The above copyright notice and this permission notice must be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.