Git Product home page Git Product logo

apache-kafka-connector's Introduction

Apache Kafka Connector

Connect Industrial Edge Device to Apache Kafka

Description

Overview

The Apache Kafka Connector connects to the Databus and Apache Kafka. The Connector can subcribes to MQTT Topics on Databus and produces messages (events, records) on a Kafka Topic. Also the Connector can consume messages from a Kafka Topic and publishes messages to MQTT Topics on Databus.

General task

This example shows how to connect your Industrial Edge Device to Apache Kafka. Therefore a SIMATIC PLC is used as datasource. The OPC UA Connector reads the data from the PLC and publish them on Databus. The Apache Kafka Connector consists of two services, the "kafka-producer" and "kafka-consumer". The "kafka-producer" subscribes to the Databus, gets data from OPC UA Connector and produces messages in an Apache Kafka Broker's topic. The "kafka-consumer" subscribes to the same topic on the Apache Kafka Broker and publishes the data an other topic on Databus. The Flow Creator can be used to verify the data exchange between Industrial Edge and Apache Kafka.

Overview

Requirements

Used Components

  • OS: Windows or Linux
  • Docker minimum V18.09
  • Docker Compose V2.0 – V2.4
  • Industrial Edge App Publisher (IEAP) V1.2.8
  • Industrial Edge Management (IEM) V1.5.2-4 / V1.11.8
    • OPC UA Connector V1.8.1
    • Common Connector Configurator V1.8.1-4
    • Databus V2.0.0-4
    • Databus Configurator V2.0.0-5
    • IE App Configuration Service V1.2.2
  • Industrial Edge Device (IED) V1.10.0-9
  • TIA Portal V16
  • PLC: CPU 1512 FW 2.8.3

TIA Project

The used TIA Portal project can be found in the miscellaneous repository in the tank application folder and is also used for several further application examples:

Prerequisites

Before using this application make sure you have a running Apache Kafka Broker. To setup up a test environment either follow the Apache Kafka Quickstart guide or use the provided docker-compose.yml as described here

Installation

You can find the further information about the following steps in the docs

Usage

Connect your Industrial Edge Device to a PLC as datasource over the network.

Provide a Apache Kafka Broker (see Prerequisites) that is accessible for the Industrial Edge Device over the network

Use e.g. Flow Creator to verify data exchange to and from Apache Kafka Broker.

Test

Implementation

How to implement a Apache Kafka Producer and Consumer as well as further details about the source code can be found in the implementation section.

Documentation

Contribution

Thank you for your interest in contributing. Anybody is free to report bugs, unclear documentation, and other problems regarding this repository in the Issues section. Additionally everybody is free to propose any changes to this repository using Pull Requests.

If you haven't previously signed the Siemens Contributor License Agreement (CLA), the system will automatically prompt you to do so when you submit your Pull Request. This can be conveniently done through the CLA Assistant's online platform. Once the CLA is signed, your Pull Request will automatically be cleared and made ready for merging if all other test stages succeed.

License and Legal Information

Please read the Legal information.

Disclaimer

IMPORTANT - PLEASE READ CAREFULLY:

This documentation describes how you can download and set up containers which consist of or contain third-party software. By following this documentation you agree that using such third-party software is done at your own discretion and risk. No advice or information, whether oral or written, obtained by you from us or from this documentation shall create any warranty for the third-party software. Additionally, by following these descriptions or using the contents of this documentation, you agree that you are responsible for complying with all third party licenses applicable to such third-party software. All product names, logos, and brands are property of their respective owners. All third-party company, product and service names used in this documentation are for identification purposes only. Use of these names, logos, and brands does not imply endorsement.

apache-kafka-connector's People

Contributors

ariefkasim avatar boehmi-tb avatar filipd147 avatar hilariosiemens avatar stancd-siemens avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

apache-kafka-connector's Issues

SSL Authentication

I need to implement SSL Authentication. Is there possibility to add keys in Admin and Consumer instances to do that ?

BR

Bug Report : network loop missing in consumer

I encountered the following problem, the messages received from the kafka broker were correctly received but often they did not reach the IE DATABUS.

I add client.loop_start() to run the network loop and it looks much better :)

mqtt.py

# Connect MQTT-Client to MQTT Broker (IE Databus)
client.connect(config.MQTT['HOST'], int(config.MQTT['PORT']), 60)
client.loop_start()

def publish (topic, msg):
    print('publish message: ' + msg + ' topic: ' + topic)
    client.publish(topic, msg)

Addidional packages required before installation

Issue-template

Summary

pip installation only possible after installing following packages:

sudo apt install python3.10-venv
python3 -m venv .venv
source .venv/bin/activate
sudo apt install python3-wheel
sudo apt install build-essential
sudo  apt-get install python3-dev
sudo apt install librdkafka-dev

Version of the used components

Which versions of the Industrial Edge components did you use?
e.g.

  • Ubuntu 22.04

Steps to reproduce

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.