(20241224) MCX data test.

This commit is contained in:
2024-12-24 16:54:56 +05:30
parent 362a5540a3
commit 79e53ca6a8
3 changed files with 218 additions and 33 deletions
+15 -14
View File
@@ -28,25 +28,26 @@ from utils_v2.queue.async_kafka import ProducerKafka, ConsumerKafka, get_ssl_con
import os
# Define the test params:
TOPIC = "kft_file_upload"
TOPIC = "tickers"
BOOTSTRAP_SERVERS = "del.ditscentre.in:9092"
SSL_CONTEXT = get_ssl_context(
ca_file = "../../creds/kafka/cert_authority.pem",
cert_file = "../../creds/kafka/fullchain.pem",
key_file = "../../creds/kafka/privkey.pem"
)
# cwd = files.get_cwd()
# # parent_dir = files.get_parent_directory(cwd, 2)
# parent_dir = cwd
# print("CWD:", cwd)
# # print("PD:", parent_dir)
# SSL_CONTEXT = get_ssl_context(
# ca_file = "../../creds/kafka/cert_authority.pem",
# cert_file = "../../creds/kafka/fullchain.pem",
# key_file = "../../creds/kafka/privkey.pem"
# ca_file = os.path.join(parent_dir, "creds", "kafka", "cert_authority.pem"),
# cert_file = os.path.join(parent_dir, "creds", "kafka", "fullchain.pem"),
# key_file = os.path.join(parent_dir, "creds", "kafka", "privkey.pem")
# )
cwd = files.get_cwd()
# parent_dir = files.get_parent_directory(cwd, 2)
parent_dir = cwd
print("CWD:", cwd)
# print("PD:", parent_dir)
SSL_CONTEXT = get_ssl_context(
ca_file = os.path.join(parent_dir, "creds", "kafka", "cert_authority.pem"),
cert_file = os.path.join(parent_dir, "creds", "kafka", "fullchain.pem"),
key_file = os.path.join(parent_dir, "creds", "kafka", "privkey.pem")
)
my_consumer = ConsumerKafka(
topic = TOPIC,
bootstrap_servers = BOOTSTRAP_SERVERS,