Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Output of Tmap not sending to Kafka

I need to send output of Tmap ( 5 fields) as a msg to a Kafka topic. But kafka topic takes only byte[] as input . How to convert this 5 fields  first into an XML or JSON format  and then into Byte array and send as a single msg to Kafka ? 

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi
You can try to use tWriteJsonField or tWriteXMLField after tMap to write a Json or XMl string, and then convert the string to byte[]. Please refer to the component documentation and learn these two components.

Regards
Shong

View solution in original post

3 Replies
Anonymous
Not applicable
Author

Hi
You can try to use tWriteJsonField or tWriteXMLField after tMap to write a Json or XMl string, and then convert the string to byte[]. Please refer to the component documentation and learn these two components.

Regards
Shong
Anonymous
Not applicable
Author

Thanks . Yes this works fine but to convert again String to Byte[]) after twritejson to tkakafop using getBytes() method ,is there any alternative  to using another tmap to convert . I just want to reduce the components for such simple conversions . 

Also tmap is not getting connected after twritejson field . What is the logic behind which talend decides which component is allowed to connect another component

Anonymous
Not applicable
Author

I usually do this simple conversion on a tJavaRow after twriteJsonField, I don't understand ' tmap is not getting connected after twritejson field .", it should be! like
...tWriteJsonField--main--tJavaRow(or tMap)....