Login  Register

Re: Flink Data Stream Union

Posted by flinkuser on Oct 21, 2015; 1:09pm
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/Flink-Data-Stream-Union-tp3169p3197.html

The issue is i cannot get any data on msgDataStream2.print(), however msgDataStream1.print() produces some data.

On Wed, Oct 21, 2015 at 9:02 AM, flinkuser [via Apache Flink User Mailing List archive.] <[hidden email]> wrote:
Here is the strange behavior.

Below code works in one box but not in the other. I had it working in my laptop the whole of yesterday, but strangely today it doesnt work in my desktop.

Can anyone please let me know what the issue is.


public static void main(String[] args) throws Exception {
                try {
                        final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
                        DataStream<String> msgDataStream1 = env.addSource((new SocketSource(hostName1, port, '\n', -1))).filter(new MessageFilter()).setParallelism(1);
                        DataStream<String> msgDataStream2 = env.addSource((new SocketSource(hostName2, port, '\n', -1))).filter(new MessageFilter()).setParallelism(1);

                        env.execute("Stock stream");

                } catch (Exception e) {  
                        System.err.println("Exception  = > " + e.getMessage());
                        e.printStackTrace();
                }
        }

        private static void unionMessageStreams(DataStream<String> msgDataStream1, DataStream<String> msgDataStream2) {
                try {
               
                        DataStream<String> ds = msgDataStream1.union(msgDataStream2);
                        ds.print();
                } catch (Exception e) {
                        System.err.println("Exception in union Message Streams () = > " + e.getMessage());
                }
        }

Thanks


If you reply to this email, your message will be added to the discussion below:
http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Flink-Data-Stream-Union-tp3169p3196.html
To unsubscribe from Flink Data Stream Union, click here.
NAML



--
Gayu