You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/03/03 17:06:54 UTC
[GitHub] [camel-kafka-connector] oscerd commented on issue #1082: telegram connector convert to json
oscerd commented on issue #1082:
URL: https://github.com/apache/camel-kafka-connector/issues/1082#issuecomment-789893060
With 0.8.0 or 0.7.0 and with camel-jackson in the classpath of the connector try:
```
name=CamelTelegramSourceConnector
connector.class=org.apache.camel.kafkaconnector.telegram.CamelTelegramSourceConnector
tasks.max=1
key.converter=org.apache.kafka.connect.storage.StringConverter
value.converter=org.apache.kafka.connect.converters.ByteArrayConverter
camel.source.marshal=json-jackson
topics=topic_name
camel.source.endpoint.authorizationToken=<auth_token>
camel.source.path.type=bots
```
The output will be
```
./kafkacat -b localhost:9092 -t topic_name -C
{"date":1614790989,"from":{"id":xxx,"username":"xxxx","bot":false,"first_name":"xxx","last_name":"xxx","is_bot":false},"text":"ciao","chat":{"id":"xxx","title":null,"type":"private","all_members_are_administrators":false},"photo":null,"video":null,"audio":null,"document":null,"sticker":null,"entities":null,"caption":null,"game":null,"message_id":10,"location":null,"caption_entities":null,"reply_markup":null}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org