You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to get some topic info using confluent python admin client , i am getting below error. Do i need set anything to enable at the broker side ???
INFO:producer.main:Admin client created successfully
INFO:producer.main:Calling list_topics()...
ERROR:producer.main:Error fetching topic metadata: KafkaError{code=_TRANSPORT,val=-195,str="Failed to get metadata: Local: Broker transport failure"}
Traceback (most recent call last):
File "/home/app/app/producer/main.py", line 179, in fetch_topic_metadata
cluster_metadata = admin_client.list_topics(topic=topic, timeout=10)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/app/venv/lib/python3.12/site-packages/confluent_kafka/admin/init.py", line 639, in list_topics
return super(AdminClient, self).list_topics(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cimpl.KafkaException: KafkaError{code=_TRANSPORT,val=-195,str="Failed to get metadata: Local: Broker transport failure"}
effetch_topic_metadata():
"""Fetch metadata for the configured Kafka topic"""bootstrap_servers=os.getenv('KAFKA_BOOTSTRAP_SERVERS')
# Create Admin client with OAuth bearer tokenauth=TokenClientCredentials(ADMIN_CLIENT_ID, ADMIN_CLIENT_SECRET, SCOPE, TENANT_ID)
admin_client=AdminClient({
'bootstrap.servers': bootstrap_servers,
'security.protocol': 'SASL_SSL',
'sasl.mechanism': 'OAUTHBEARER',
'oauth_cb': auth,
'ssl.ca.location': '/home/jboss/cluster/ca.crt'
})
logger.info("Admin client created successfully")
topic=os.getenv("KAFKA_TOPIC")
try:
# Fetch cluster metadata for the specific topicstart_time=time.time()
logger.info("Calling list_topics()...")
# Fix the typo: 'imeout' -> 'timeout'cluster_metadata=admin_client.list_topics(topic=topic, timeout=10)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to get some topic info using confluent python admin client , i am getting below error. Do i need set anything to enable at the broker side ???
INFO:producer.main:Admin client created successfully
INFO:producer.main:Calling list_topics()...
ERROR:producer.main:Error fetching topic metadata: KafkaError{code=_TRANSPORT,val=-195,str="Failed to get metadata: Local: Broker transport failure"}
Traceback (most recent call last):
File "/home/app/app/producer/main.py", line 179, in fetch_topic_metadata
cluster_metadata = admin_client.list_topics(topic=topic, timeout=10)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/app/venv/lib/python3.12/site-packages/confluent_kafka/admin/init.py", line 639, in list_topics
return super(AdminClient, self).list_topics(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cimpl.KafkaException: KafkaError{code=_TRANSPORT,val=-195,str="Failed to get metadata: Local: Broker transport failure"}
Beta Was this translation helpful? Give feedback.
All reactions