Producing the sample messages - 7.1

Java custom code for Storm

author
Talend Documentation Team
EnrichVersion
7.1
EnrichProdName
Talend Data Fabric
Talend Open Studio for Big Data
Talend Real-Time Big Data Platform
task
Data Governance > Third-party systems > Custom code components (Integration) > Java custom code component for Storm
Data Quality and Preparation > Third-party systems > Custom code components (Integration) > Java custom code component for Storm
Design and Development > Third-party systems > Custom code components (Integration) > Java custom code component for Storm
EnrichPlatform
Talend Studio

About this task

In the real-world practice, the system that produces messages to Kafka is completely decoupled. While in this scenario, Kafka itself is used to produce the sample messages. You need to perform the following operations to produce these messages:

Procedure

  1. Create the Kafka topic to be used to categorize the messages. The following command is used for demonstration purposes only. If you need further information about the creation of a Kafka topic, see Apache's documentation for Kafka./usr/lib/kafka/bin/kafka-topics.sh --zookeeper localhost:2181 --create --topic activities --partitions 1 --replication-factor 1
    This command creates a topic named activities, using the Kafka brokers managed by the Zookeeper service on the localhost machine.
  2. Publish the message you want to analyze to the activities topic you have just created. In this scenario, Kafka is used to perform this publication using, for example, the following command:
    echo 'Ryan|M|Pool
    Remy|M|Drink
    Remy|M|Hiking
    Irene|F|Drink
    Pierre|M|Movie
    Irene|F|Pool
    Thomas|M|Drink
    Ryan|M|Cooking
    Wang|F|Cooking
    Chen|M|Drink | /usr/lib/kafka/bin/kafka-console-producer.sh --broker-list  localhost:9092 --topic  activities
    This command publishes 10 simple messages
    Ryan|M|Pool
    Remy|M|Drink
    Remy|M|Hiking
    Irene|F|Drink
    Pierre|M|Movie
    Irene|F|Pool
    Thomas|M|Drink
    Ryan|M|Cooking
    Wang|F|Cooking
    Chen|M|Drink
    As explained previously, you can use your actual message producer system instead to perform the publication.