Exemplo n.º 1
0
        public TestInputTopic <K, V> CreateInputTopic <K, V>(string topicName, ISerDes <K> keySerdes, ISerDes <V> valueSerdes)
        {
            var pipeBuilder = new SyncPipeBuilder(GetTask(topicName));
            var pipeInput   = pipeBuilder.Input(topicName, configuration);

            return(new TestInputTopic <K, V>(pipeInput, configuration, keySerdes, valueSerdes));
        }
Exemplo n.º 2
0
        public TestOutputTopic <K, V> CreateOutputTopic <K, V>(string topicName, TimeSpan consumeTimeout, ISerDes <K> keySerdes = null, ISerDes <V> valueSerdes = null)
        {
            var pipeBuilder = new SyncPipeBuilder(null, producer);
            var pipeOutput  = pipeBuilder.Output(topicName, consumeTimeout, configuration, token);

            return(new TestOutputTopic <K, V>(pipeOutput, topicConfiguration, keySerdes, valueSerdes));
        }
Exemplo n.º 3
0
        public TestMultiInputTopic <K, V> CreateMultiInputTopic <K, V>(string[] topics, ISerDes <K> keySerdes = null, ISerDes <V> valueSerdes = null)
        {
            Dictionary <string, IPipeInput> pipes = new Dictionary <string, IPipeInput>();

            foreach (var t in topics)
            {
                var task    = GetTask(t);
                var builder = new SyncPipeBuilder(task);
                pipes.Add(t, builder.Input(t, configuration));
            }

            return(new TestMultiInputTopic <K, V>(pipes, configuration, keySerdes, valueSerdes));
        }
Exemplo n.º 4
0
        private Dictionary <string, IPipeInput> BuildPipeInputs(string[] topics)
        {
            Dictionary <string, IPipeInput> pipes = new Dictionary <string, IPipeInput>();

            foreach (var t in topics)
            {
                var task            = GetTask(t);
                var syncPipeBuilder = new SyncPipeBuilder(task);
                var pipeInput       = syncPipeBuilder.Input(t, configuration);
                pipes.Add(t, pipeInput);
            }

            return(pipes);
        }