Skip to main content Skip to complementary content

Configuring the components

Procedure

  1. Double-click the cTimer component to display its Basic settings view in the Component tab. Keep the default settings of the options as shown below.
  2. Double-click the first cSetBody component, which is labeled SetBodyAsJsonString, to open its Basic settings view in the Component tab.
  3. Select Constant from the Language drop-down list and type in the JSON string "{\"my_field1\": 1,\"my_field2\": 72438939,\"my_field3\": \"my demo Test message\"}" in the Expression field as the message body.
  4. Click the Component tab of the first cMap component, which is labeled ConvertBodyToAvro and open its Basic settings view.
  5. Click the [...] button next to the Map Path field and select the map “Avro/Sample_JSON_to_AVRO”.
  6. Select Object from the Output Type drop-down list.
  7. Click the Component tab of the second cMap component, which is labeled ConvertBodyToJsonString and open its Basic settings.
  8. Click the [...] button next to the Map Path field and select the map “Avro/Sample_AVRO_to_JSON”.
  9. Select Byte Array from the Output Type drop-down list.
  10. Double-click the first cKafka component, which is labeled SendMessageToKafka, to open its Basic settings view in the Component tab.
  11. In the Broker List field, enter "localhost:9092".
    In the Topic field, enter "demo.AVRO".
    In the Serializer Class field, enter "org.example.local_project.beansjar.kafka_avro_beans.KafkaAvroSerializerBean". Make sure you replace local_project with the Talend project name.
    Keep the default settings of the other options.
  12. Open Advanced settings view in the Component tab.
  13. In the Kafka Properties field, add a parameter with the name "schemaRegistryURL" and the value "localhost:8081".
  14. Double-click the second cKafka component, which is labeled ReceiveMessageFromKafka, to open its Basic settings view in the Component tab.
  15. In the Broker List field, enter "localhost:9092".
    In the Topic field, enter "demo.AVRO".
    Keep the default settings of the other options.
  16. Open Advanced settings view in the Component tab.
  17. In the Kafka Properties field, add two parameters with the name "schemaRegistryURL" and "valueDeserializer", and the value "localhost:8081" and "org.example.local_project.beansjar.kafka_avro_beans.KafkaAvroDeserializerBean" respectively. Make sure you replace local_project with the Talend project name.
  18. Keep the default settings of the cLog components to log the message exchanges.
  19. Press Ctrl+S to save your Route.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!