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

camel-mongodb-kafka-connector produce message format error #1113

Closed
yingbo-wu opened this issue Mar 19, 2021 · 3 comments
Closed

camel-mongodb-kafka-connector produce message format error #1113

yingbo-wu opened this issue Mar 19, 2021 · 3 comments

Comments

@yingbo-wu
Copy link

The “camel.source.endpoint.consumerType” is changeStreams

{
    ......
    "camel.source.endpoint.consumerType": "changeStreams",
    ......
}

The kafka topic message format is:
Document{{_id=6054153bb0c98c76191cd377, sfdc_id=a0L2x000001GjBgEAK, field_3=Fri Mar 05 00:00:00 GMT 2021, field_1=123, field_2=123}}

The format is that the "Document" object toString() returns something
Such a data format cannot be used downstream

@yingbo-wu
Copy link
Author

"value.converter": "org.apache.kafka.connect.storage.StringConverter"

@yingbo-wu
Copy link
Author

My solution is

"value.converter": "org.apache.kafka.connect.json.JsonConverter",
"camel.source.marshal": "org.apache.camel.component.gson.GsonDataFormat",

But, The official example is "value.converter": "org.apache.kafka.connect.storage.StringConverter"

@yingbo-wu yingbo-wu changed the title The camel-mongodb-connector produce message format error The camel-mongodb-kafka-connector produce message format error Mar 19, 2021
@yingbo-wu yingbo-wu changed the title The camel-mongodb-kafka-connector produce message format error camel-mongodb-kafka-connector produce message format error Mar 19, 2021
@oscerd
Copy link
Contributor

oscerd commented Mar 19, 2021

The pojo returned is always Document. You can transform it in json by unmarshalling it with json-jackson dataformat which is provided out of the box and by default in all the connectors. Thanks.

@oscerd oscerd closed this as completed Mar 19, 2021
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

No branches or pull requests

2 participants