I am working on a stream process which can takes informations inside my MySQL database and parse them into a NoSQL database (with InfluxDB). At this point, i am able to send a NoSQL query through a HTTP Request, but only if i want to send integer value. The problem is when i want to send a string value, i can't use double quotes inside my "Text" payload, because it will close my attribut. If i use single quote around my string value, InfluxDB returns an error :
[2018-12-28_11-07-18_302] INFO {org.wso2.siddhi.core.stream.output.sink.LogSink} - log : Event{timestamp=1545991638301, data=[{"error":"unable to parse 'SEQTIME value=267,x_date_create={1}': invalid boolean"} ], isExpired=false} (Encoded)
There is my code :
@sink(type='http-request',
publisher.url='http://localhost:8086/write?db=bd_sensor_values',
method='POST',
headers="'Authorization: Basic XXXXX','Content-Type: application/x-www-form-urlencoded','cache-control: no-cache','Host:localhost:8086'",
sink.id="httpRequest_id",
@map(type='text', @payload("SEQTIME value={{id}},x_date_create={{x_date_create}}")))
define stream httpRequest (id int, x_date_create string);
The problem is inside the @payload attribut, with x_date_create. I tried to encode my double quotes, but it didn't work (maybe i did it wrong ?)
Any idea ? Thank you !