Hi,
I am trying to read from a stream and wrtie json to a kafka pubisher. I
have selected json
There is an extra set of quotes at the beginning of twitterMessage, which
prevents the parsing library [jackson] from treating it as a either valid
string or valid object

*Note the  quote after the : following twitterMessage [In bold] *
{"twitterMessage*":"*{"payload":"


Unexpected character ('p' (code 112)): was expecting comma to separate
Object entries
 at [Source: 
{"event":{"payloadData":{"twitterMessage*":"*{"payload":"@romainmazon
@lagazettefr .@romainmazon Développer la #smartcity, un levier important de
collaboration entre\u2026 https:\/\/t.co
\/NPxYLRVLJ3","topic":"tweets\/EDF_Entreprises","tweet":{"extended_tweet":{"entities":{"urls":[{"display_url":"
po.st\/8gjOk3","indices":[137,160],"expanded_url":"http:\/\/po.st
\/8gjOk3","url":"https:\/\/t.co\/JXyw5qeiDT"}],"hashtags":[{"indices":[54,64],"text":"smartcity"},{"indices":[109,118],"text":"CollTerr"},{"indices":[122,134],"text":"entreprises"}],"user_mentions":[{"indices":[0,12],"screen_name":"romainmazon","id_str":"170391427","name":"romain
mazon","id":170391427},
2:33 PM

The following is the configuration of the Event Publisher


<?xml version="1.0" encoding="UTF-8"?>
<eventPublisher name="KafkaEventPublisher" statistics="disable"
  trace="disable" xmlns="http://wso2.org/carbon/eventpublisher";>
  <from streamName="TweetStream" version="1.0.0"/>
  <mapping customMapping="disable" type="json"/>
  <to eventAdapterType="kafka">
    <property name="topic">SmartCity</property>
    <property name="meta.broker.list">localhost:9092</property>
  </to>
</eventPublisher>

The following is the configuration of the Event Reciever
<?xml version="1.0" encoding="UTF-8"?>
<eventReceiver name="TwitterReceiver" statistics="disable"
    trace="disable" xmlns="http://wso2.org/carbon/eventreceiver";>
    <from eventAdapterType="websocket">
        <property
name="websocket.server.url">ws://localhost:1880/node-red/twitterStream</property>
        <property name="events.duplicated.in.cluster">false</property>
    </from>
    <mapping customMapping="enable" type="json">
        <property>
            <from jsonPath="$"/>
            <to name="twitterMessage" type="string"/>
        </property>
    </mapping>
    <to streamName="TweetStream" version="1.0.0"/>
</eventReceiver>

 Sincerely,
Sagar R. Kapadia
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to