---
# ----------------------------------------------------------------------------#
# Commissioning File
# ----------------------------------------------------------------------------#
# Copyright: Cybus GmbH (2020)
# Contact: support@cybus.io
# ----------------------------------------------------------------------------#
# Source Interface Definition - Kafka broker
# ----------------------------------------------------------------------------#

description: >
  Sample commissioning file for communicating with Kafka broker (consumer)

metadata:
  name: Apache Kafka Connectivity
  icon: https://www.cybus.io/wp-content/uploads/2017/10/for-whom1.svg
  provider: cybus
  homepage: https://www.cybus.io
  version: 0.0.1

parameters:
  param_brokers:
    description: Hosts or IP addresses of the Apache Kafka broker
    type: string
    default: 192.168.0.1:9092

resources:
  kafkaConnection:
    type: Cybus::Connection
    properties:
      protocol: Kafka
      connection:
        clientType: 'consumer'
        brokers: [
          !ref param_brokers
        ]

  kafkaSubscribeExample:
    type: Cybus::Endpoint
    properties:
      protocol: Kafka
      connection: !ref kafkaConnection
      subscribe:
        fromBeginning: false
        topic: some_test_topic