How do I iterate over each message in a Flink DataStream?
<p>I have a message stream from Kafka like the following </p>

<pre><code>DataStream&lt;String&gt; messageStream = env
  .addSource(new FlinkKafkaConsumer09&lt;&gt;(topic, new MsgPackDeserializer(), props));
</code></pre>

<p>How can I iterate over each message in the stream and do something with it? I see an <code>iterate()</code> method on <code>DataStream</code> but it does not return an <code>Iterator&lt;String&gt;</code>.</p>