private StreamPipelineWrapper CreateStreamPipelineWrapper() { StreamPipelineWrapper ForKafka() { var client = new KafkaStreamClient(KafkaConfigForSample.BrokerList); var topic = client.StreamTopic(TopicConfiguration.Topic).Into(streamId => ProcessStream(streamId, dataFormatClient)); return(new StreamPipelineWrapper(client, topic)); } StreamPipelineWrapper ForMqtt() { var client = new MqttStreamClient(MqttConnectionConfigForSample.Current); var topic = client.StreamTopic(TopicConfiguration.Topic).Into(streamId => ProcessStream(streamId, dataFormatClient)); return(new StreamPipelineWrapper(client, topic)); } switch (Configuration.SelectedTransport) { case StreamingTransport.Kafka: return(ForKafka()); case StreamingTransport.Mqtt: return(ForMqtt()); default: throw new NotSupportedException(); } }
public override IStreamPipelineBuilder OpenStreamTopic(string topicName) { return(client.StreamTopic(topicName)); }