Configure message brokers

Kalix eventing integrates with Google Cloud Pub/Sub and managed Kafka services such as Confluent Cloud and Aiven for Apache Kafka to enable asynchronous messaging.

Message brokers are configured on Kalix Project level. A project can have one broker configuration, Kalix eventing is independent of the broker technology.

Testing Kalix eventing

The Java SDK testkit has built-in support to simulate message brokers. See Testing the Integration.

Using a Kafka broker locally

During development, you may want to run a local Kafka broker for testing.

The docker-compose example file below shows how to set the kalix.proxy.eventing.support to kafka. A volume is mounted to the current directory ., which is expected to contain a kafka.properties file. The BROKER_CONFIG_FILE environment variable points to the kafka.properties file in the mounted volume 'conf', which ensures that the service can connect to Kafka.

version: "3"
services:
  kalix-runtime:
    image: gcr.io/kalix-public/kalix-proxy:1.1.45
    command: -Dkalix.proxy.eventing.support=kafka
    ports:
      - "9000:9000"
    extra_hosts:
      - "host.docker.internal:host-gateway"
    environment:
      BROKER_CONFIG_FILE: /conf/kafka.properties
    volumes:
      - .:/conf

You can check out a complete example in Java Customer Registry (with Kafka).