Four Stars

tRESTREST API of KAFKA giving error


I have Kafka REST API working fine on my Linux distro. I am able to write message to the queue using the curl command. However I would like to replicate the writing to the queue in Talend.


I have been trying various options to write to the queue without any success. I have tried tREST, tRESTclient but couldn't achieve.


Below is the curl command I have tried which works fine.


curl -X POST -H "Content-Type: application/vnd.kafka.json.v2+json" --data '{"records":[{"value":{"name": "testUser"}}]}' "http://localhost:8082/topics/test"


This works fine.

I have screen shot of the job I created. I have tried to create a job in many ways.


I am not sure if the job is correct or it should be done in different way. Please help.




Community Manager

Re: tRESTREST API of KAFKA giving error

tRestClient requires a Document as request parameter, you need to use a tXMLMap before tRestClient to generate a Document. Have a try to use tRest component if you want to pass the data body as string.

Talend | Data Agility for Modern Business
Four Stars

Re: tRESTREST API of KAFKA giving error

Hi, I am already getting the input as document. Actually I am using Talend ESB which has webservice component to receive messages over SOAP. This message is passed to the RestClient to invoke rest action but it fails giving rest error 500.