code: def __init__(self, frontend_url=None, **kwargs):
      host = kwargs.get("host") if kwargs.get("host") else "localhost"
      port = kwargs.get("port") if kwargs.get("port") else "9092"
      self.topic_name = (
          kwargs.get("topic_name")
          if kwargs.get("topic_name")
          else "serving_stream"
      )
      self.interval_if_error = 1
      for key in ["host", "port", "topic_name"]:
          if key in kwargs:
              kwargs.pop(key)
      # create a kafka producer
      self.db = KafkaProducer(
          bootstrap_servers=host + ":" + port,
          key_serializer=lambda k: json.dumps(k).encode("utf-8"),
          value_serializer=lambda v: json.dumps(v).encode("utf-8"),
          **kwargs,
      )
  
file_path: BigDL/python/serving/src/bigdl/serving/kafka/client.py
imports: from kafka import KafkaProducer, KafkaConsumer
  from kafka.errors import kafka_errors
  import json
  from bigdl.serving.schema import *
  from bigdl.serving.log4Error import invalidInputError
label_desc: Use image node_id 1 to create a new InputQueue object  with example: obj = InputQueue(frontend_url)