- if not self.kafka.host or not self.kafka.port:
- missing_relations.append("kafka")
-
- if missing_relations:
- raise RelationsMissing(missing_relations)
+ @property
+ def kafka_endpoint(self) -> KafkaEndpoint:
+ config = ConfigModel(**dict(self.config))
+ if config.kafka_endpoint:
+ host, port = config.kafka_endpoint.split(":")
+ else:
+ host = self.kafka.host
+ port = self.kafka.port
+ return KafkaEndpoint(host, port)