Help Center/
MapReduce Service/
Developer Guide (Normal_3.x)/
Kafka Development Guide (Security Mode)/
Application Commissioning/
Consumer Sample Commissioning
Updated on 2023-08-31 GMT+08:00
Consumer Sample Commissioning
Prerequisites
- Ensure that Windows is configured to allow Kafka access through an EIP if you need to debug applications on Windows. For details, see How Do I Access Kafka of the Cluster in Security Mode on Windows Using EIPs?.
- Ensure that the current user has the read permission on all files in the src/main/resources directory and the dependent library file directory if you need to debug applications on Linux. Ensure that the JDK has been installed and Java environment variables have been set.
Commissioning Applications on Windows
- Ensure that the mappings between the host names and service IP addresses of all the hosts in the remote cluster are configured in the local hosts file.
- Run Consumer.java on IntelliJ IDEA, as shown in Figure 1.
- Click Run. In the displayed console window, you can see that Producer starts after Consumer has started and you can view the messages received in real time.
Figure 2 Consumer.java running window
Commissioning Applications on Linux
- Compile and generate a JAR package, and copy the JAR package to the src/main/resources directory at the same level as the dependent library folder. For details, see Commissioning Applications on Linux.
- Run the following command to run the consumer sample project:
java -cp /opt/client/lib/*:/opt/client/src/main/resources com.huawei.bigdata.kafka.example.Consumer
Parent topic: Application Commissioning
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot