ensure_topic_exists#

langchain_community.chat_message_histories.kafka.ensure_topic_exists(admin_client: AdminClient, topic_name: str, replication_factor: int, partition: int, ttl_ms: int) β†’ int[source]#

Create topic if it doesn’t exist, and return the number of partitions. If the topic already exists, we don’t change the topic configuration.

Parameters:
  • admin_client (AdminClient)

  • topic_name (str)

  • replication_factor (int)

  • partition (int)

  • ttl_ms (int)

Return type:

int