Search code examples
javaapache-kafkaapache-flink

Two data streams in one flink job


I have two infinite kafka data streams in one flink job, like this:

StreamExecutionEnvironment environment = StreamExecutionEnvironment.getExecutionEnvironment();
DataStream kafka1 = ...
DataStream kafka2 = ...

kafka1.process();
kafka2.process();

environment.execute();

Does the process of the two streams are parallel or in sequence?


Solution

  • If only use one environment, the task will run in parallel.