Beispiel #1
0
        /// <summary>
        /// Add a new internal topic.
        /// </summary>
        /// <param name="name">Topic Name</param>
        /// <param name="topicCreationConfig"></param>
        public KafkaStreamOptions AddTopic(string name, TopicCreationConfig topicCreationConfig = null)
        {
            var config = new TopicConfig {
                IsExternal = false, Name = name
            };

            if (topicCreationConfig != null)
            {
                config.AutoCreate        = topicCreationConfig.AutoCreate;
                config.Partitions        = topicCreationConfig.Partitions;
                config.ReplicationFactor = topicCreationConfig.ReplicationFactor;
            }

            Topics.Add(config);

            return(this);
        }
Beispiel #2
0
        /// <summary>
        /// Add a new external topic.
        /// </summary>
        /// <param name="type">The data type that this contract will use.</param>
        /// <param name="name">Topic Name</param>
        /// <param name="topicCreationConfig"></param>
        public KafkaStreamOptions AddExternalTopic(
            Type type,
            string name,
            TopicCreationConfig topicCreationConfig = null
            )
        {
            var config = new TopicConfig {
                IsExternal = true, Name = name, ExternalContractType = type
            };

            if (topicCreationConfig != null)
            {
                config.AutoCreate        = topicCreationConfig.AutoCreate;
                config.Partitions        = topicCreationConfig.Partitions;
                config.ReplicationFactor = topicCreationConfig.ReplicationFactor;
            }

            Topics.Add(config);

            return(this);
        }
Beispiel #3
0
 /// <summary>
 /// Add a new external topic.
 /// </summary>
 /// <param name="name">Topic Name</param>
 /// <param name="topicCreationConfig"></param>
 public KafkaStreamOptions AddExternalTopic <T>(string name, TopicCreationConfig topicCreationConfig = null)
 {
     AddExternalTopic(typeof(T), name, topicCreationConfig);
     return(this);
 }