-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
wheelly
committed
Feb 18, 2024
1 parent
0dfaaf9
commit 580af85
Showing
4 changed files
with
18 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
from confluent_kafka import Producer | ||
from kafka import KafkaProducer | ||
from testcontainers.kafka import KafkaContainer | ||
def get_kafka_container() -> KafkaContainer: | ||
return KafkaContainer().with_bind_ports(KafkaContainer.KAFKA_PORT, KafkaContainer.KAFKA_PORT) | ||
return (KafkaContainer(image="confluentinc/cp-kafka:latest") | ||
.with_bind_ports(KafkaContainer.KAFKA_PORT, KafkaContainer.KAFKA_PORT)) | ||
|
||
def get_kafka_producer(bootstrap_servers: str) -> Producer: | ||
return Producer({ | ||
"bootstrap.servers": bootstrap_servers, | ||
"group.id": "integration-tests" | ||
}) | ||
def get_kafka_producer(bootstrap_servers: str) -> KafkaProducer: | ||
return KafkaProducer(bootstrap_servers=bootstrap_servers) |
This file contains 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
This file contains 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