Kafka

Apache Kafka is an open-source distributed event streaming platform with applications in many industries. Kafka runs as a cluster of one or more Kafka servers which communicate with clients. Clients can act as consumers by receiving messages from Kafka servers or as producers by publishing messages. Kafka messages (also known as events or records in the documentation) are categorized by topics. Each message within a topic can have an optional key, used for message organization and partitioning.

The Kafka Device Driver is a client which can serve as both a consumer and producer, allowing Iotellect Server to exchange messages with Kafka servers.

Driver Information

Driver Plugin ID:

com.tibbo.linkserver.plugin.device.kafka

Global Settings

None defined.

User Level Settings

None defined.

Device Account Properties

Connection Properties

Connection settings define how Iotellect Server will connect to Kafka instances, and which topics will be polled. Here is a list of available connection properties:

Property

Description

Broker Addresses

Data table specifying the details of the Kafka broker for the client's initial connection.

  • Broker Address. IP address of the target broker.

  • Port Number. Port number of the Kafka advertised listeners on the target broker.

Topics

List of topics to which the device will be subscribed.

Max Poll Records

The maximum number of records to be returned per poll request.

Poll Duration

Maximum amount of time to wait for a response during a poll request.

Auto Commit Interval

The amount of time which that the consumer offsets will be auto-committed to Kafka.

Consumer Group ID

Identifier of the Kafka consumer group that this device belongs to.

Device Assets

Assets are not supported by the driver.

Device Settings

The Kafka Device Driver creates one Device setting variable:

Variable Name

Variable Description

Comments

messageCount

Message Count

Count of received messages. Value is updated every synchronization. Reconnection resets count to zero.

Device Operations

Publish Text Message

This function allows the device to act as a message producer by writing a message to a topic.

The format of the function input parameters has the following fields:

Name

Type

Description

topic

String

Indicates the topic where the message should be written.

textMessage

String

Value of the message.

key

String

Key value for the message. If left <not set> the broker will automatically generate the key.

The function has no output parameters.

Device Events

Message

Fired when Iotellect Server receives a message to one of the topics listed in connection properties.

Event Name

message

Permissions:

Accessible at Observer permission level

Records:

1

Record Format:

Field Name

Field Type

Notes

topic

String

The topic of the message.

key

String

The key of the received message.

textMessage

String

Text of the received message.

partition

String

Indicates which partition the message is stored in.

offset

String

Used to maintain the current position of the consumer and ensure the same message is not received twice.

key

String

Used for message organization and partitioning within a topic.

Synchronization Details

Kafka driver polls the Kafka cluster and subscribes to the topics indicated in connection properties.

This driver will mark the device Offline if a connection cannot be established with Kafka broker.

Was this page helpful?