<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Fabric Eventstream Kafka JSON Issues in Eventstream</title>
    <link>https://community.fabric.microsoft.com/t5/Eventstream/Fabric-Eventstream-Kafka-JSON-Issues/m-p/4017549#M123</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="466155" data-lia-user-login="joakimfenno" class="lia-mention lia-mention-user"&gt;joakimfenno&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P&gt;&lt;FONT&gt;Ensure Proper JSON Formatting: Verify that the JSON data being sent from your Python script is correctly formatted. Each message should be a valid JSON object. If sending multiple objects, ensure they are either encapsulated in an array&amp;nbsp;or separated by new lines if sending line-separated objects.&lt;/FONT&gt;&lt;CODE&gt;[{}]&lt;/CODE&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Validate JSON Before Sending: Use a JSON validation tool to ensure that the JSON data is valid before sending it to the EventStream. This can help catch any formatting issues upfront.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Review Kafka Producer Configuration: Ensure that your Kafka producer in the Python script is configured to send data as a string that represents a valid JSON object or objects. You might need to serialize your data to a JSON string if not already doing so.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;Escape Special Characters: In Python, you can use the `json.dumps()` function to serialize your data into a valid JSON format. This function will automatically escape special characters like double quotes.&amp;nbsp;&lt;A href="https://www.geeksforgeeks.org/json-dumps-in-python/" target="_blank"&gt;json.dumps() in Python - GeeksforGeeks&lt;/A&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Neeko Tang&lt;/P&gt;
&lt;P&gt;If this post  &lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution &lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 01 Jul 2024 02:41:58 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-07-01T02:41:58Z</dc:date>
    <item>
      <title>Fabric Eventstream Kafka JSON Issues</title>
      <link>https://community.fabric.microsoft.com/t5/Eventstream/Fabric-Eventstream-Kafka-JSON-Issues/m-p/4015360#M122</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have a python script where we use Kafka to try to send some simple JSON-data to an EventStream in Fabric for testing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See screenshot of code here:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We can see data activity in the EventStream:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When trying to preview the JSON data we get the following error message:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Data preview "KafkaJSON": ["Source 'EventHubInputAdapter' had 1 occurrences of kind 'InputDeserializerError.InvalidData' between processing times '2024-06-27T12:47:06.6200231Z' and '2024-06-27T12:47:06.6200231Z'. Json input stream should either be an array of objects or line separated objects. Found token type: String"’&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;When previewing as CSV it looks like the ”-characters in the original strings have been replaced with \&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do we need to escape the ”-characters in some way when sending messages to the Eventstream?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2024 10:15:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Eventstream/Fabric-Eventstream-Kafka-JSON-Issues/m-p/4015360#M122</guid>
      <dc:creator>joakimfenno</dc:creator>
      <dc:date>2024-06-28T10:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: Fabric Eventstream Kafka JSON Issues</title>
      <link>https://community.fabric.microsoft.com/t5/Eventstream/Fabric-Eventstream-Kafka-JSON-Issues/m-p/4017549#M123</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="466155" data-lia-user-login="joakimfenno" class="lia-mention lia-mention-user"&gt;joakimfenno&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P&gt;&lt;FONT&gt;Ensure Proper JSON Formatting: Verify that the JSON data being sent from your Python script is correctly formatted. Each message should be a valid JSON object. If sending multiple objects, ensure they are either encapsulated in an array&amp;nbsp;or separated by new lines if sending line-separated objects.&lt;/FONT&gt;&lt;CODE&gt;[{}]&lt;/CODE&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Validate JSON Before Sending: Use a JSON validation tool to ensure that the JSON data is valid before sending it to the EventStream. This can help catch any formatting issues upfront.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Review Kafka Producer Configuration: Ensure that your Kafka producer in the Python script is configured to send data as a string that represents a valid JSON object or objects. You might need to serialize your data to a JSON string if not already doing so.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;Escape Special Characters: In Python, you can use the `json.dumps()` function to serialize your data into a valid JSON format. This function will automatically escape special characters like double quotes.&amp;nbsp;&lt;A href="https://www.geeksforgeeks.org/json-dumps-in-python/" target="_blank"&gt;json.dumps() in Python - GeeksforGeeks&lt;/A&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Neeko Tang&lt;/P&gt;
&lt;P&gt;If this post  &lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution &lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2024 02:41:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Eventstream/Fabric-Eventstream-Kafka-JSON-Issues/m-p/4017549#M123</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-01T02:41:58Z</dc:date>
    </item>
  </channel>
</rss>

