KAFKA
Introduction
The WeHub Dashboard offers a variety of plugins to enhance and automate your workflows. These plugins are categorized into three types: Triggers, Processors, and Apps. This documentation provides an overview of the "Kafka" plugin, which falls under the Triggers category.
Kafka Plugin
The "Kafka" plugin is used to handle Kafka messaging within your workflow. This plugin provides two actions: Kafka Subscribe and Kafka Publish. Each action has the same configuration requirements.
Actions
- Kafka Subscribe: Used to start a workflow when a message is received on a specified Kafka topic.
- Kafka Publish: Used to publish a message to a specified Kafka topic as part of a workflow.
Configuration
When configuring either of the Kafka actions, you need to provide the following inputs:
- Label: A descriptive label to identify this action within your workflow.
- Connection: Select an existing connection to your Kafka server or create a new connection.
- Topic: Input the name of the Kafka topic.
- Group Id: Input the group ID for the Kafka consumer group.
- Partition: Input the partition number.
- Start Offset: Input the start offset for message consumption.
Additionally, you can add a header configuration. If a header is added, you need to provide the following inputs for each header:
- Name: Input the name of the header.
- Value: Input the value of the header.
Configuration Steps
- Label: Provide a meaningful label for this action. For example, "Order Messages Subscription".
- Connection:
- Select an existing Kafka connection from the dropdown menu.
- If no connection exists, click on "Create new connection" and follow the prompts to establish a new connection.
- Topic: Input the name of the Kafka topic you want to subscribe to or publish messages to.
- Group Id: Input the group ID for the Kafka consumer group.
- Partition: Specify the partition number.
- Start Offset: Specify the start offset for message consumption.
If you choose to add headers, input the following for each header:
- Name: Provide the name of the header.
- Value: Provide the value of the header.
Example Configuration
Configuration Fields:
- Label: Order Messages Subscription
- Connection: KafkaConnection1
- Topic: orders
- Group Id: order-group
- Partition: 0
- Start Offset: latest
Header Configuration (Optional):
- Name: Content-Type
- Value: application/json
Example Usage
Let's consider a scenario where you want to configure the Kafka Subscribe action to start a workflow when a message is received on the "orders" topic.
Configuration Input:
- Label: Order Messages Subscription
- Connection: Select your authorized Kafka connection.
- Topic: orders
- Group Id: order-group
- Partition: 0
- Start Offset: latest
Header Configuration (if applicable):
- Name: Content-Type
- Value: application/json
In your workflow, you can insert the Kafka Subscribe action to initiate the workflow when a message is received on the specified topic.
Workflow Integration
Here is how you might integrate the Kafka plugin into a workflow:
- Kafka Subscribe: The workflow starts with the Kafka Subscribe action that activates upon receiving a message on the specified topic.
- Data Processing: The workflow proceeds to process the received Kafka message data.
- Kafka Publish: The workflow sends a message to a Kafka topic using the Kafka Publish action if needed.
Conclusion
The Kafka plugin in the WeHub Dashboard is a versatile tool for managing Kafka messaging within your workflows. By configuring the label, connection, topic, group ID, partition, and start offset, you can efficiently handle Kafka communications in various scenarios. Ensure to test and validate your configurations to achieve the desired workflow behavior.
If you have any further questions or need additional assistance, please refer to the WeHub Dashboard support documentation or contact our support team.