class_docstr: Kafka event broker.
class_docstr_tok: ["Kafka","event","broker","."]
code: def _create_producer(self) -> "Producer":
      import confluent_kafka
  
      try:
          return confluent_kafka.Producer(self._get_kafka_config())
      except confluent_kafka.KafkaException as e:
          raise KafkaProducerInitializationError(
              f"Cannot initialise `KafkaEventBroker`: {e}"
          )
  
imports: import asyncio
  import os
  import json
  import logging
  import structlog
  import threading
  from asyncio import AbstractEventLoop
  from typing import Any, Text, List, Optional, Union, Dict, TYPE_CHECKING
  import time
  from rasa.core.brokers.broker import EventBroker
  from rasa.core.exceptions import KafkaProducerInitializationError
  from rasa.shared.utils.io import DEFAULT_ENCODING
  from rasa.utils.endpoints import EndpointConfig
  import rasa.shared.utils.common
label_desc: Use image node_id 5 for calling the KafkaEventBroker obj's underlying member method code with example usage: obj._create_producer() and returns: confluent_kafka