title: Kafka streams - KSQL - Split messages and publish to another topic
body: <p>Is there a way to split a message into multiple messages using KSQL and publish to a new topic. Just to be clear, I am not looking for a Java based listener and iterate/stream it to a new topic; instead, I am looking for a KSQL that does that for me. </p>
  
  <p>For example:</p>
  
  <p>Let's say, I need messages in <code>invoice</code> topic split into <code>item_inventory_delta</code> messages</p>
  
  <h2><strong>invoice</strong> topic</h2>
  
  <p><strong>key</strong>: saleschecknumber</p>
  
  <p><strong>message example:</strong> </p>
  
  <pre><code>{
      "total": 12.33,
      "salecounter": 1,
      "items": [
          {
              "itemId": 123,
              "quantity": 1
          },
          {
              "itemId": 345,
              "quantity": 5
          }
      ]
  }
  </code></pre>
  
  <h2><strong>item_inventory_delta</strong> topic</h2>
  
  <p><strong>key</strong>: saleschecknumber_itemID</p>
  
  <p><strong>message examples</strong></p>
  
  <h2>1.</h2>
  
  <pre><code>{
      "itemId": 123,
      "quantity": 1
  }
  </code></pre>
  
  <p>2.</p>
  
  <pre><code>{
      "itemId": 345,
      "quantity": 5
  }
  </code></pre>