Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid json string error thrown in JsonSinkMapper #228

Closed
dilini-muthumala opened this issue Apr 23, 2021 · 0 comments · Fixed by siddhi-io/siddhi#1723
Closed

Invalid json string error thrown in JsonSinkMapper #228

dilini-muthumala opened this issue Apr 23, 2021 · 0 comments · Fixed by siddhi-io/siddhi#1723

Comments

@dilini-muthumala
Copy link
Contributor

Description:
The JSON sink mapper thorws the followng error when tryong to create a nested json format.

ERROR {io.siddhi.extension.map.json.sinkmapper.JsonSinkMapper} - Invalid json string : {"event":{"alertTypeData":{"PublisherName":"ee","AlertCategory":"rr","AlertType":"rr"},"recipientData":{"recipientType":"rr"}. Hence dropping the message.

Affected Product Version:
wso2si-4.0.0, wso2si-tooling-4.0.0

OS, DB, other environment details and versions:
N/A

Steps to reproduce:

@App:name("PreDefinedProducerApp") 
@App:description("PreDefined Local Kafka Producer App")
define stream DataStream(PublisherName string,AlertCategory String,AlertType String,recipientType String);
@sink(type='log', 
@map(type='json', enclosing.element='event', validate.json='true', @payload("""{"alertTypeData":{"PublisherName":"{{PublisherName}}","AlertCategory":"{{AlertCategory}}","AlertType":"{{AlertType}}"},"recipientData":{"recipientType":"{{recipientType}}"}}""")))
define stream DataWriteStream (PublisherName string, AlertCategory string, AlertType string, recipientType string);
from DataStream
select PublisherName, AlertCategory, AlertType , recipientType
insert into DataWriteStream;

Related Issues:
wso2/product-sp#1075

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant