title: Parse string in json format from Kafka using Flink
body: <p>What I want to do is reading a string in json format e.g.</p>
  
  <pre><code>{"a":1, "b":2}
  </code></pre>
  
  <p>using flink and then extract a specific value by its key, say 1.</p>
  
  <p>Refer to here: <a href="https://ci.apache.org/projects/flink/flink-docs-release-1.2/dev/connectors/kafka.html" rel="nofollow noreferrer">https://ci.apache.org/projects/flink/flink-docs-release-1.2/dev/connectors/kafka.html</a></p>
  
  <p>What I have done is:</p>
  
  <pre><code>val params = ParameterTool.fromArgs(args)
  val env = StreamExecutionEnvironment.getExecutionEnvironment
  
  val kafkaConsumer = new FlinkKafkaConsumer010(
    params.getRequired("input-topic"),
    new JSONKeyValueDeserializationSchema(false),
    params.getProperties
  )
  
  val messageStream = env.addSource(kafkaConsumer)
  </code></pre>
  
  <p>But I am not quite sure how to move forward then. In the link above, it says I can use <code>objectNode.get(“field”).as(Int/String/…)()</code> to extract a specific value by key, but I wonder how can I do that? </p>
  
  <p>Or there can be a completely different way to achieve what I want?</p>
  
  <p>Thanks!</p>