翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。
このプロセスでは、認証を使用してメッセージを生成および消費する方法について説明します。
-
次のコマンドを実行して、トピックを作成します。
client.properties
という名前のファイルは、前の手順で作成したファイルです。<path-to-your-kafka-installation>
/bin/kafka-topics.sh --create --bootstrap-serverBootstrapBroker-String
--replication-factor 3 --partitions 1 --topic ExampleTopic --command-config client.properties -
次のコマンドを実行して、コンソールプロデューサーを起動します。
client.properties
という名前のファイルは、前の手順で作成したファイルです。<path-to-your-kafka-installation>
/bin/kafka-console-producer.sh --bootstrap-serverBootstrapBroker-String
--topic ExampleTopic --producer.config client.properties -
クライアントマシンの新しいコマンドウィンドウで、次のコマンドを実行してコンソールコンシューマーを起動します。
<path-to-your-kafka-installation>
/bin/kafka-console-consumer.sh --bootstrap-serverBootstrapBroker-String
--topic ExampleTopic --consumer.config client.properties -
プロデューサーウィンドウにメッセージを入力し、コンシューマーウィンドウに表示されるようにします。