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

Support copying of JSON data to pubsub topic as JSON instead of stringified map. #202

Open
sriramkoopidai opened this issue Nov 29, 2022 · 4 comments
Assignees
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@sriramkoopidai
Copy link

sriramkoopidai commented Nov 29, 2022

Problem: The issue is with the sink connector, If schema is not used, JSON data in topic is pushed to pubsub topic as string value of the map.
We need a feature so that we can force the output to be JSON and could be interpreted as JSON in pubsub.

Example for JSON object
{"name":"bob","id":45}

it is shown as on pubsub topic
{name=bob, id=45}

Add a configuration which could be used to force output to be JSON.

Alternativies considered:
Tried forcing the output to be string using configuration
value.converter=org.apache.kafka.connect.storage.StringConverter

pubsub topic gets the right value but the single message transforms didn't not work, for example if you want to copy json field to header, it does not work.

Example: Sample SMT

"headers.publish" : true,
"transforms": "insertAppIdHeader,moveFieldsToHeader",
"transforms.moveFieldsToHeader.type": "org.apache.kafka.connect.transforms.HeaderFrom$Value",
"transforms.moveFieldsToHeader.fields": "name,id",
"transforms.moveFieldsToHeader.headers": "name,id",

@lqiu96
Copy link

lqiu96 commented Dec 5, 2022

Do you have a repro that we could follow/ use?

CC: @anguillanneuf who may have more context regarding this issue.

@samarthsingal
Copy link
Contributor

Could you share the sink connector config you are using?

@lqiu96 lqiu96 added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. priority: p3 Desirable enhancement or fix. May not be included in next release. labels Dec 8, 2022
@ThomasBarach
Copy link

Hello, I'm hitting this issue as well. Did you manage to do something about it?
Regards

@CatherineThompson
Copy link

Hi, I've also run into this issue. Is there a workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
6 participants