Creating Kafka listeners

The connector for Apache Kafka listener continually monitors a Kafka topic for messages. When a message is produced on a topic, the listener fetches the message and passes it to a listener notification for further processing.

Before you begin

To create a listener for a project, you must have a Kafka consumer account that is created and enabled. For more information, see Kafka.

Procedure

  1. Go to the project in which you want to create a listener.
  2. Click Events > Listeners.
  3. Click New Listener. The Add Listener screen appears.
  4. Enter the required details in the Add Listener screen.
    1. In the Type of listener field, select Kafka from the list for which you want to create a listener.
    2. In the Select version field, select the connector version.
  5. Enter the required details in the Listener page of the Add Listener configuration screen.
    1. In the Listener name field, provide a name of the listener that listens for messages on a Kafka topic.
    2. In the Connection name field, specify a name of the connection that the listener must use to connect to the server to retrieve messages. From the list of connections, select an appropriate consumer connection.
      Note: The list contains both the producer and consumer connections. Select the consumer connection.
    3. In the Retry limit field, specify a value for the number of reconnection attempts a listener makes when it fails to connect or loses its connection with the Kafka server. The default value is 5.
    4. In the Retry backoff timeout (ms) field, specify a time in milliseconds that must elapse between each of the retries that are specified in the Retry Limit. The default value is 10.

    Listener settings

    1. In the Topic name(s) field, specify a comma-separated list of topics on which the Kafka listener listens.
    2. In the Poll interval (ms) field, specify the polling interval time in milliseconds. The default value is 10000.
    3. In the Partition(s) field, specify a comma-separated list of partitions.
    4. In the Offset(s) field, specify a comma-separated offset from where the consumer needs to start consuming the messages.
      Note:
      • The number of offsets cannot be greater than the number of partitions.
      • Listener is not supported for multiple topic subscriptions when multiple partitions or seek offset are provided.
      • The offset values are ignored if the partition is not specified.
  6. Click Next. The Overview page appears.
  7. Review the listener configuration details.
  8. Click Add listener. The listener is saved and enabled.
  9. Click Done to complete and close the listener configurations without adding the Listener Notification. If you want to continue adding a listener notification, click Next. For more information, see Adding Kafka listener notifications.