Creating a Kafka service
You can create a Kafka service to expose a message-based interface to external clients, which can interact asynchronously with workflow automations.
Kafka services enable message event-driven interactions with workflow automations. A Kafka service exposes a message-based interface to external clients, which can send Kafka message events, for example, to trigger processes or service flows asynchronously. This enables loosely coupled, asynchronous interactions between clients and workflow automations.
Before you begin
- Enabling Kafka services in Business Automation Workflow Authoring and Workflow Process Service Authoring
- Add
kafkatosc_optional_componentsin the ICP4ACluster custom resource:shared_configuration: # The following ensures that Kafka is installed and Kafka services is enabled sc_optional_components: kafka - Enabling Kafka services in Business Automation Workflow Runtime
- If you want to enable Kafka, add
kafkatosc_optional_componentsin the ICP4A Cluster custom resource. For example:shared_configuration: # The following ensures that Kafka is installed and Kafka services is enabled sc_optional_components: kafka - Enabling Kafka services in Workflow Process Service Runtime
- Enable Kafka services in the
WfPSRuntimecustom resource by adding the following:spec: kafka_services: enable: true
Procedure
To create and model your Kafka service:
Results
- Using the Kafka services
- The AsyncAPI definition of a Kafka service describes the operations and their expected message
event schemas and the name of the Kafka topic. You use this information in the Kafka client of your
choice to send message events to the respective topic. For each message event, the corresponding
service flow or process of your default workflow automation version is triggered.You can get the AsyncAPI definition for your Kafka service from the following URL:
where host_name is the host name, port is the port number, custom_prefix is an optional custom prefix, workflow_automation_acronym is the acronym of the workflow automation, and kafka_service_name is the name of the Kafka service.http://host_name:port/[custom_prefix/]automationservices/kafka/workflow_automation_acronym/kafka_service_name/docsIn a runtime environment, the URL retrieves the AsyncAPI definition from the default version of the workflow automation. In a development environment, the URL retrieves the AsyncAPI definition from the tip of the default branch.
In the development environment, before you can send message events to a topic, you must create a version.
Kafka services can be triggered with the credentials specified in the
kafka-service-external-client-usersecret. The secret also specifies the certificate of the Kafka server that you must add to your trust store of your Kafka client application.