Chapter 20. Configuring a KIE Server to send and receive Kafka messages from the process

To run a process that sends or receives Kafka messages (except when using the custom task), you must use a KIE Server. You must configure this KIE Server to integrate with Red Hat AMQ Streams.

Procedure

  1. To enable integration with Red Hat AMQ Streams, set the following system properties according to your environment:

    • If you are using the KIE Server on Red Hat JBoss EAP, set the org.kie.kafka.server.ext.disabled system property of the KIE Server to false.
    • If you are using Spring Boot, set the kieserver.kafka.enabled system property to true.
  2. To configure the connection to the Kafka broker, set the org.kie.server.jbpm-kafka.ext.bootstrap.servers system property to the host and port of the broker. The default value is localhost:9092. You can use a comma-separated list of multiple host:port pairs.
  3. Optional: Set any of the following system properties to configure sending and receiving Kafka messages:

    • org.kie.server.jbpm-kafka.ext.client.id: An identifier string to pass to the broker when making requests. Red Hat AMQ Streams uses this string for logging.
    • org.kie.server.jbpm-kafka.ext.topics.*: Mapping of message names to topic names. For example, if you want to send or receive a message in the ExampleTopic topic when ExampleName is the name of the message, set the org.kie.server.jbpm-kafka.ext.topics.ExampleName system property to ExampleTopic. You can set any number of such system properties. If a message name is not mapped using a system property, the process engine uses this name as the topic name.
  4. Optional: Set any of the following system properties to configure receiving Kafka messages:

    • org.kie.server.jbpm-kafka.ext.allow.auto.create.topics: Allow automatic topic creation. Enabled by default.
    • org.kie.server.jbpm-kafka.ext.group.id: A unique string that identifies the group to which this Kafka message consumer belongs. The default value is jbpm-consumer.
  5. Optional: Set any of the following system properties to configure sending Kafka messages:

    • org.kie.server.jbpm-kafka.ext.acks: The number of acknowledgements that the Kafka leader must receive before marking the request as complete. The default value is 1, which means the leader writes the record to its local log and then responds to the process engine, without waiting for full acknowledgement from all followers.
    • org.kie.server.jbpm-kafka.ext.max.block.ms: The number of milliseconds for which the publish method blocks. After this time, the process engine can resume execution of the business process. The default value is 2000 (2 seconds).