Repository navigation
Use the Azure SASL_SSL settings in the Event Hubs Kafka producer - #139
Open
bryansan-local wants to merge 1 commit into
Open
bryansan-local wants to merge 1 commit into
bryansan-local wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused configuration change matches Azure’s requirements, with no identified blocking issues and reported validation against Azure and the updated emulator.
No open issues 🎉
What changed in this PR
Aligns the Event Hubs Kafka producer with Azure’s authentication requirements, using the same configuration for Azure and the updated LocalStack emulator.
Changes:
- Enables
SASL_SSLwithPLAINauthentication and connection-string credentials. - Removes the README’s outdated plaintext Kafka limitation.
| File | Description |
|---|---|
| samples/eventhubs/python/src/producers/producer_kafka.py | Configures Azure-compatible TLS and SASL authentication. |
| samples/eventhubs/python/README.md | Removes the obsolete emulator plaintext note. |
Review effort: Balanced
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The emulator now serves
SASL_SSLon the Event Hubs Kafka endpoint (localstack/localstack-pro#9645), so the Kafka producer can use the settings Azure requires instead of describing them in a comment.Changes
producer_kafka.pyalways setssecurity.protocol=SASL_SSL,sasl.mechanism=PLAIN,sasl.username=$ConnectionStringand the connection string assasl.password, so the same config works against LocalStack and Azure.Tests
producer_kafka.pypublished 15 of 15 events to the namespace created by each deployment (Azure CLI, Bicep, Terraform). The version onmainfails there withDisconnected while requesting ApiVersion, since Azure only acceptsSASL_SSL.deploy.shandvalidate.shpass, andrun-pipeline.shingests all 75 payments, 15 of them over Kafka.Part of SMF-955