Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Property Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
      • Get a Tailored Demo
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +32 2 290 34 90
    • Get a Tailored Demo
  • Pricing
  • Help
  1. APPS
  2. Technical
  3. OdooCraft Kafka Connector v 18.0
  4. Sales Conditions FAQ

OdooCraft Kafka Connector

by Odoo Craft
Odoo

$ 116.42

v 18.0 Third Party
Apps purchases are linked to your Odoo account, please sign in or sign up first.
Availability
Odoo Online
Odoo.sh
On Premise
Lines of code 5091
Technical Name odoocraft_kafka_connector
LicenseOPL-1
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Lines of code 5091
Technical Name odoocraft_kafka_connector
LicenseOPL-1
  • Description
  • License

OdooCraft Kafka Connector

Connect Odoo to Apache Kafka. Produce, consume, and encode messages — managed entirely from the Odoo UI.

Odoo 18 Community Edition Apache Kafka AVRO Schema Registry

The Problem

Odoo is a closed loop. Data changes inside Odoo — orders confirmed, inventory moved, invoices paid — and nothing outside knows about it unless you build custom integrations from scratch. Each one is a one-off: brittle webhooks, cron-based CSV exports, or expensive middleware that sits between systems and adds latency.

Apache Kafka solves this at the architecture level. A central event bus where every system publishes what it knows and subscribes to what it needs. The problem is that Odoo has no native Kafka support. Until now there was no clean way to connect them.

What You Get

Connection Management Configure Kafka connections directly in Odoo. SASL PLAIN, SASL SSL, and plain TCP. Certificates stored securely as binary fields. Topic Configuration Define topics with consumer group, serialization format, batch size, DLQ topic, and custom config — all from a form view.
Background Workers Consumer workers start automatically with the Odoo process. No separate service needed. Supports both batch-commit and direct-commit modes. AVRO + Schema Registry Encode and decode messages using AVRO. Schemas loaded from Odoo addons at startup, registered to Schema Registry automatically.
Dead Letter Queue Failed messages are wrapped in a structured envelope (payload + headers + error type + retry count) and routed to a dedicated error topic. Offset is committed; the partition keeps moving. Nothing is silently dropped. JSON Field Widget Built-in OWL component for editing and viewing JSON data inline in Odoo forms. Syntax validation, read-only tree view, and key sorting.
Message Logs kafka.message.log stores an audit trail: direction, status, payload, partition, offset, timing, and errors. Browse in Kafka → Message Logs. Live Dashboard Real-time Kafka dashboard on the Connection form — Consumed, Produced, Pending counters per topic, refreshed every 5 seconds directly from the broker.

Architecture

Odoo Instance
├── kafka.connection   — broker URL, auth method, SSL certs
├── kafka.topic        — topic name, consumer group, format (JSON/AVRO), DLQ
├── KafkaAvroHelper    — serialize / deserialize using confluent_kafka
└── SchemaRegistryHelper — load .avsc files from addons, register to Schema Registry

Background Workers (run inside the Odoo server process)
├── workers/__init__.py  — patch PreforkServer / ThreadedServer at startup
├── KafkaWorker          — main loop, partition assignment, offset management
├── KafkaWorkerBatch     — accumulate messages, commit on batch or timeout
└── KafkaWorkerDirect    — commit each message individually, lower throughput / higher safety

External
├── Apache Kafka (KRaft or ZooKeeper)
└── Confluent Schema Registry (optional, required for AVRO)

How It Works

1
Install the module and the Python dependency
pip install confluent-kafka must be available in the Odoo virtualenv. Install the module from Apps, restart the server.
2
Create a Connection
Go to Kafka → Connections. Add your broker address, choose an auth method, and click Test Connection to verify.
3
Configure a Topic
Define the topic name, consumer group, message format (JSON or AVRO), batch settings, and optionally a DLQ topic for failed messages.
4
Implement your handler
Add a method to any Odoo model and point the topic record at it. The worker calls it for each incoming message.
5
Restart and verify
Workers start with the Odoo process. Logs appear under the odoocraft_kafka_connector log queue.

Configuring Topics and Consumer Handlers

Every Kafka topic is represented by a kafka.topic record linked to a connection.

Step 1 — Create the topic record

Field Required Description
Topic NameYesExact Kafka topic name, e.g. odoo.orders
Create Consumer—Enable to subscribe and receive messages. Disable for producer-only topics.
ModelIf consumerThe Odoo model that contains the handler method.
Handle MethodIf consumerName of the Python method to call for each message.
AVRO Encoding—Enable for AVRO; requires Schema Registry URL on the connection.
Need Send Error Report—Enable DLQ forwarding. Select the Error Topic below.

Step 2 — Write the handler in your module

from odoo import api, models

class SaleOrderKafkaHandler(models.AbstractModel):
    _name = "sale.order.kafka.handler"
    _description = "Handles incoming Kafka messages for orders"

    @api.model
    def handle_order_message(self, message: dict, headers: dict = None) -> None:
        order_id    = message.get("order_id")
        partner_ref = message.get("customer_ref")
        amount      = message.get("amount", 0)

        partner = self.env["res.partner"].search(
            [("ref", "=", partner_ref)], limit=1
        )
        if not partner:
            raise ValueError(f"Unknown partner ref: {partner_ref}")

        self.env["sale.order"].create({
            "partner_id":       partner.id,
            "client_order_ref": order_id,
            "order_line": [(0, 0, {
                "product_id":      self.env.ref("product.product_product_1").id,
                "price_unit":      amount,
                "product_uom_qty": 1,
            })],
        })

Set Model to sale.order.kafka.handler and Handle Method to handle_order_message.

Step 3 — Produce messages from your module

class SaleOrder(models.Model):
    _inherit = "sale.order"

    def action_confirm(self):
        res = super().action_confirm()
        topic = self.env["kafka.topic"].search(
            [("name", "=", "odoo.orders")], limit=1
        )
        if topic:
            for order in self:
                topic.send_message(
                    {
                        "order_id":     order.name,
                        "partner_id":   order.partner_id.id,
                        "amount_total": order.amount_total,
                        "currency":     order.currency_id.name,
                        "state":        order.state,
                    },
                    headers={
                        "source":        "odoo",
                        "correlationId": str(order.id),
                    },
                )
        return res

Step 4 — Enable and monitor

  1. Set start_kafka_worker = True in odoo.conf and restart Odoo.
  2. Open the topic form and click Start Consumer.
  3. Go to the Connection form to see the live Kafka dashboard — Consumed, Produced, Pending counters updated every 5 seconds.
  4. Go to Kafka → Message Logs to inspect individual messages, payloads, and errors.
  The Consumer Group field shows the auto-computed Kafka consumer group ID. All topics on the same connection share one group. If you need independent consumers, create a separate connection record.

Connection Examples

SASL PLAIN (development / Confluent Cloud)
Bootstrap Servers:  pkc-xxxxx.us-east-1.aws.confluent.cloud:9092
Auth Method:        SASL PLAIN
Username:           your-api-key
Password:           your-api-secret
SASL SSL with client certificate
Bootstrap Servers:  broker.internal:9093
Auth Method:        SASL SSL
CA Certificate:     (upload ca.pem)
Client Certificate: (upload client.pem)
Client Key:         (upload client.key)
Username:           kafka-user
Password:           kafka-pass
Local development with Docker Compose
Bootstrap Servers:  localhost:9092
Auth Method:        SASL PLAIN
Username:           admin
Password:           admin-secret
  A ready-to-use docker-compose.yml for local Kafka development is included in the docker/ directory. It starts a single-node KRaft broker with SASL PLAIN authentication and Confluent Schema Registry.

AVRO Configuration

To use AVRO encoding, place .avsc schema files anywhere in your Odoo addons and configure the Schema Registry URL on the connection. Schemas are discovered and registered automatically at worker startup.

my_module/
└── schemas/
    └── order_event.avsc
{
  "type": "record",
  "name": "OrderEvent",
  "namespace": "com.mycompany.odoo",
  "fields": [
    {"name": "order_id",   "type": "int"},
    {"name": "state",      "type": "string"},
    {"name": "amount",     "type": "double"},
    {"name": "timestamp",  "type": "string"}
  ]
}

Dead Letter Queue (DLQ)

OdooCraft Kafka Connector provides a built-in Dead Letter Queue mechanism that captures every failed message with its full diagnostic context and routes it to a dedicated error topic for later inspection and replay.

How it works

  1. Decode failure — the worker cannot deserialize the raw bytes. Content is Base64-encoded and forwarded to the DLQ. Offset is committed; partition keeps moving.
  2. Processing failure — deserialization succeeds but the handler raises an exception. The worker retries up to the configured limit, then forwards to the DLQ.
  3. DLQ send failure — if the error topic is unreachable, the failure is logged but the main consumer continues. No cascading crash.

DLQ message envelope

{
  "original_topic":  "odoo.orders",
  "timestamp":       "2025-11-01T14:32:07Z",
  "error_type":      "KeyError",
  "error_message":   "'partner_id' is required",
  "retry_count":     3,
  "headers": { "correlationId": "abc-123", "source": "shop-frontend" },
  "payload": { "order_id": "SO-9981", "amount": 4500 }
}

Configuration

  1. Create a dedicated kafka.topic record for the error topic (e.g. odoo.orders.dlq) on the same connection.
  2. On the source topic form, enable Need Send Error Report and select the DLQ topic.
  If Need Send Error Report is checked but no error topic is configured, the worker raises a UserError on the first failure. Always set both fields together.

Message Logs

Column Description
DirectionConsumed (in) or Produced (out)
StatusSuccess or Error
PayloadFull JSON payload (interactive viewer, truncated at 64 KB)
Partition / OffsetExact position in the Kafka partition
Processing TimeHandler execution time in milliseconds (consumed messages)
ErrorFull error message when status is Error

Old entries can be cleaned up via Settings → Kafka Connector → Cleanup Message Logs or by configuring the built-in scheduled action.

Odoo Startup Options

start_kafka_worker = True                   # Enable Kafka consumer workers (default: False)
kafka_start_delay = 10                      # Seconds to wait before starting workers (default: 10)
kafka_batch_size = 50                       # Messages per batch iteration (default: 50)
kafka_batch_timeout_ms = 10                 # poll() timeout per slot in ms (default: 10)
kafka_batch_max_wait_ms = 100               # Max wall-clock time per batch in ms (default: 100)
kafka_dashboard_broker_refresh_seconds = 5  # Live dashboard lag refresh interval (default: 5)
  Set start_kafka_worker = True in odoo.conf to activate consumers. Workers are disabled by default so the module can be installed without a Kafka broker available.

Screenshots

Kafka Connections list

Connections list — PLAINTEXT, SASL PLAIN, and SASL SSL connections at a glance

Connection configuration form

Connection form — Broker, SASL authentication, and Schema Registry in logical groups

Live Kafka dashboard on connection form

Live dashboard — Consumed, Produced, and Pending counters per topic refreshed every 5 seconds

Topic configuration form

Topic form — Start / Stop consumer, Reset Offset, View Logs directly from the form

Topic form with AVRO enabled

AVRO mode — enable one checkbox and the Schema Registry fields appear automatically

Message Logs list

Message Logs — produced traffic and configurable inbound logging (direction, status, timing)

Message Log detail with JSON payload

Log detail — full JSON payload with syntax highlighting, partition, offset, and processing time

Requirements

Requirement Details
Odoo version18.0 Community or Enterprise
Python packageconfluent-kafka>=2.3.0
AVRO supportconfluent-kafka[avro]>=2.3.0 (optional)
KafkaApache Kafka 2.8+ (KRaft or ZooKeeper)
Schema RegistryConfluent Schema Registry (optional, AVRO only)

Compatibility

Designed and tested on Odoo 18 Community Edition. Does not modify any core Odoo models — all extensions are additive.

Questions or issues? Reach us at panmasiunas@gmail.com

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.

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author or have a question related to your purchase, please use the support page.
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with