If Apache Iggy is useful to you, give it a star on GitHubStar apache/iggy
Apache Iggy
SDKPython
These are the docs for Apache Iggy 0.9, kept for reference and no longer updated. Server 0.10.0 changed the wire protocol, so 0.9 clients and servers do not work with 0.10.0. Read the current docs.

Examples

Working Python examples from the core repository, covering connection strings, message headers and TLS.

Working examples are available in the examples/python directory. CI runs the source examples against a source-built server, including a separate TLS pass:

  • getting-started - producer and consumer with optional TLS via TcpConfig
  • basic - producer and consumer using connection strings
  • message-headers - user headers with str, bytes, bool, int, and float values, in two variants: plain-headers (plain dict, the SDK infers wire types) and typed-headers (explicit HeaderKey/HeaderValue)

Running the examples

These examples target Iggy 0.9.0. Start the server:

# Server 0.9.0
docker run --rm \
  --cap-add=SYS_NICE --security-opt seccomp=unconfined --ulimit memlock=-1:-1 \
  -p 8090:8090 \
  -e IGGY_TCP_ADDRESS=0.0.0.0:8090 \
  -e IGGY_NODE_ADVERTISED_ADDRESS=localhost \
  -e IGGY_ROOT_USERNAME=iggy -e IGGY_ROOT_PASSWORD=iggy \
  apache/iggy:0.9.0

# Or from the repository root
cargo run --bin iggy-server -- --fresh --with-default-root-credentials

The environment variables make the server reachable through the published port (it binds to 127.0.0.1 inside the container by default) and bootstrap the iggy/iggy root credentials for new data. Stored credentials are not replaced, and environment credentials override the source command's default-credentials flag. Use --fresh only with disposable local replica data.

With Python 3.10 or newer and Rust/Cargo available, run from examples/python. uv uses the local SDK path in pyproject.toml; the pip command below names that path explicitly:

# Using uv
uv sync
uv run getting-started/producer.py
uv run getting-started/consumer.py

# Without uv
python -m venv .venv
source .venv/bin/activate
pip install ../../foreign/python .
python getting-started/producer.py
python getting-started/consumer.py

For the quick-start code itself, see the Python SDK intro.

On this page