public void TestJoinPropsFrom()
        {
            var p     = StreamJoinProps.With(new TestSupplier(), new TestSupplier());
            var props = StreamJoinProps.From <string, string, string>(p);

            Assert.IsNotNull(props);
            Assert.IsAssignableFrom <TestSupplier>(props.LeftStoreSupplier);
            Assert.IsAssignableFrom <TestSupplier>(props.RightStoreSupplier);
            Assert.IsNull(props.Name);
            Assert.IsNull(props.StoreName);
            Assert.IsNull(props.KeySerdes);
            Assert.IsNull(props.LeftValueSerdes);
            Assert.IsNull(props.RightValueSerdes);
        }
Exemplo n.º 2
0
        public void StreamSameStoreName()
        {
            var config = new StreamConfig <StringSerDes, StringSerDes>
            {
                ApplicationId = "test-stream-stream-left-join"
            };

            StreamBuilder builder = new StreamBuilder();

            var stream = builder.Stream <string, string>("topic1");

            var joinProps = StreamJoinProps.From <string, string, string>(StreamJoinProps.With(
                                                                              State.Stores.InMemoryWindowStore("test", TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10)),
                                                                              State.Stores.InMemoryWindowStore("test", TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10))));

            Assert.Throws <StreamsException>(() => builder
                                             .Stream <string, string>("topic2")
                                             .LeftJoin(stream, new MyJoinerMapper(), JoinWindowOptions.Of(TimeSpan.FromSeconds(10)), joinProps));
        }
Exemplo n.º 3
0
        public void StreamInvalidTimeSettings()
        {
            var config = new StreamConfig <StringSerDes, StringSerDes>
            {
                ApplicationId = "test-stream-stream-left-join"
            };

            StreamBuilder builder = new StreamBuilder();

            var stream = builder.Stream <string, string>("topic1");

            var joinProps = StreamJoinProps.From <string, string, string>(StreamJoinProps.With(
                                                                              State.Stores.InMemoryWindowStore("test1", TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10)),
                                                                              State.Stores.InMemoryWindowStore("test2", TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10))));

            // JoinWindowOptions.Of => use default retention => One Day
            // joinProps use supplier with retention 10 secondes => BAD THING !!
            Assert.Throws <StreamsException>(() => builder
                                             .Stream <string, string>("topic2")
                                             .LeftJoin(stream, new MyJoinerMapper(), JoinWindowOptions.Of(TimeSpan.FromSeconds(10)), joinProps));
        }