sdf = sdf.set_headers(
lambda value, key, timestamp, headers: [('APP_VERSION', APP_VERSION.encode())]
)
[NEW] New API to configure Kafka broker authentication
Docs:
- https://quix.io/docs/quix-streams/configuration.html#authentication
In version 2.6.0, we introduced the new API to specify the Kafka broker credentials via the `ConnectionConfig` object.
Previously, when connecting to the brokers with any kind of authentication, users needed to provide the same connection settings as dictionaries and do it separately for both consumer and producer.
Now, the Kafka connection can be configured once using the `ConnectionConfig` object.
With `ConnectionConfig` you may specify additional authentication settings like SASL parameters and more, and pass it as a `"broker_address"` parameter to the `Application`.
**Example:**
Configure the application to connect to the Kafka broker with SASL authentication.
python
from quixstreams import Application
from quixstreams.kafka.configuration import ConnectionConfig
connection = ConnectionConfig(
bootstrap_servers="my_url",
security_protocol="sasl_plaintext",
sasl_mechanism="PLAIN",
sasl_username="my_user",
sasl_password="my_pass"
)
app = Application(broker_address=connection)
Other Improvements
* Update requests and confluent_kafka dependencies by daniil-quix in https://github.com/quixio/quix-streams/pull/379
* Bug: configuring broker_address take priority over quix config by quentin-quix in https://github.com/quixio/quix-streams/pull/384
* Check partitions status after committing in checkpoint by quentin-quix in https://github.com/quixio/quix-streams/pull/386
* Configure the producer flush timeout with the max.poll.interval.ms by quentin-quix in https://github.com/quixio/quix-streams/pull/382
* Reduce the checkpointing log level by daniil-quix in https://github.com/quixio/quix-streams/pull/377
* Fix flaky tests that rely on kafka in docker by daniil-quix in https://github.com/quixio/quix-streams/pull/378
* Default logging configuration improvements by quentin-quix in https://github.com/quixio/quix-streams/pull/383
New Contributors
* quentin-quix made their first contribution in https://github.com/quixio/quix-streams/pull/383
**Full Changelog**: https://github.com/quixio/quix-streams/compare/v2.5.1...v2.6.0