pub enum TopicAssignment {
Primary(String),
Secondary(KafkaTopicConfig),
}
Expand description
Configuration for a “logical” topic/datasink that Relay should forward data into.
Can be either a string containing the kafka topic name to produce into (using the default
kafka_config
), or an object containing keys topic_name
and kafka_config_name
for using a
custom kafka cluster.
See documentation for secondary_kafka_configs
for more information.
Variants§
Primary(String)
String containing the kafka topic name. In this case the default kafka cluster configured
in kafka_config
will be used.
Secondary(KafkaTopicConfig)
Object containing topic name and string identifier of one of the clusters configured in
secondary_kafka_configs
. In this case that custom kafka config will be used to produce
data to the given topic name.
Implementations§
source§impl TopicAssignment
impl TopicAssignment
sourcepub fn kafka_config<'a>(
&'a self,
default_config: &'a Vec<KafkaConfigParam>,
secondary_configs: &'a BTreeMap<String, Vec<KafkaConfigParam>>,
) -> Result<KafkaParams<'a>, ConfigError>
pub fn kafka_config<'a>( &'a self, default_config: &'a Vec<KafkaConfigParam>, secondary_configs: &'a BTreeMap<String, Vec<KafkaConfigParam>>, ) -> Result<KafkaParams<'a>, ConfigError>
Get the kafka config for the current topic assignment.
§Errors
Returns ConfigError
if the configuration for the current topic assignment is invalid.