You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/kafka/getting-started-kafka/README.adoc
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -346,7 +346,7 @@ endif::[]
346
346
* https://access.redhat.com/documentation/en-us/red_hat_openshift_streams_for_apache_kafka/1/guide/7d28aec8-e146-44db-a4a5-fafc1f426ca5[Configuring topics in {product-long-kafka}^]
347
347
* {base-url}{getting-started-rhoas-cli-url-kafka}[Getting started with the rhoas CLI for {product-long-kafka}^]
Copy file name to clipboardExpand all lines: docs/kafka/kcat-kafka/README.adoc
+65-72Lines changed: 65 additions & 72 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,134 +79,124 @@ END GENERATED ATTRIBUTES
79
79
////
80
80
81
81
[id="chap-using-kafkacat"]
82
-
= Configuring and connecting Kafkacat with {product-long-kafka}
82
+
= Configuring and connecting Kcat with {product-long-kafka}
83
83
ifdef::context[:parent-context: {context}]
84
84
:context: using-kafkacat
85
85
86
86
// Purpose statement for the assembly
87
87
[role="_abstract"]
88
-
As a developer of applications and services, you can use https://github.com/edenhill/kafkacat[Kafkacat^] to test and debug your Kafka instances in {product-long-kafka}.
89
-
Kafkacat is a command-line utility for messaging in Apache Kafka 0.8 and later.
90
-
With Kafkacat, you can produce and consume messages for your Kafka instances directly from the command line,
91
-
and list topic and partition information for your Kafka instances.
88
+
As a developer of applications and services, you can use https://github.com/edenhill/kcat[Kcat^] to test and debug your Kafka instances in {product-long-kafka}.
89
+
Kcat is a command-line utility for messaging in Apache Kafka 0.8 and later.
90
+
With Kcat, you can produce and consume messages directly from the command line. You can also list topic and partition information for your Kafka instances.
92
91
93
92
ifndef::community[]
94
-
NOTE: Kafkacat is an open source community tool. Kafkacat is not a part of {product-kafka} and is therefore not supported by Red Hat.
93
+
NOTE: Kcat is an open source community tool. Kcat is not a part of {product-kafka} and is therefore not supported by Red Hat.
95
94
endif::[]
96
95
97
-
You can install and use Kafkacat to test and debug your Kafka instances in {product-kafka}.
98
-
99
96
.Prerequisites
100
-
ifndef::community[]
101
-
* You have a Red Hat account.
102
-
endif::[]
103
-
//* You have a subscription to {product-long-kafka}. For more information about signing up, see *<@SME: Where to link?>*.
104
97
* You have a running Kafka instance in {product-kafka}.
105
98
* https://adoptopenjdk.net/[JDK^] 11 or later is installed. (The latest LTS version of OpenJDK is recommended.)
106
-
* You have installed the latest supported version of https://github.com/edenhill/kafkacat[Kafkacat^] for your operating system.
99
+
* You've installed the latest supported version of https://github.com/edenhill/kcat[Kcat^] for your operating system. To verify your Kcat version, enter the following command:
107
100
+
108
-
.Verifying Kafkacat installation
109
101
[source]
110
102
----
111
-
$ kafkacat -V
112
-
113
-
kafkacat - Apache Kafka producer and consumer tool
114
-
https://github.com/edenhill/kafkacat
115
-
Copyright (c) 2014-2019, Magnus Edenhill
116
-
Version 1.6.0 (JSON, Avro, Transactions, librdkafka 1.6.1 builtin.features=gzip,snappy,ssl,sasl,regex,lz4,sasl_gssapi,sasl_plain,sasl_scram,plugins,zstd,sasl_oauthbearer)
103
+
$ kcat -V
104
+
----
105
+
+
106
+
You see output like the following example:
107
+
+
108
+
[source]
109
+
----
110
+
kcat - Apache Kafka producer and consumer tool
111
+
https://github.com/edenhill/kcat
112
+
Copyright (c) 2014-2021, Magnus Edenhill
113
+
Version 1.7.0 (librdkafka 1.3.0 builtin.features=gzip,snappy,ssl,sasl,regex,lz4,sasl_gssapi,sasl_plain,sasl_scram,plugins,zstd,sasl_oauthbearer)
117
114
----
118
115
119
116
// Condition out QS-only content so that it doesn't appear in docs.
120
117
// All QS anchor IDs must be in this alternate anchor ID format `[#anchor-id]` because the ascii splitter relies on the other format `[id="anchor-id"]` to generate module files.
121
118
ifdef::qs[]
122
119
[#description]
123
120
====
124
-
Learn how to use Kafkacat to interact with a Kafka instance in {product-long-kafka}.
121
+
Learn how to use Kcat to interact with a Kafka instance in {product-long-kafka}.
125
122
====
126
123
127
124
[#introduction]
128
125
====
129
-
Welcome to the quick start for {product-long-kafka} with Kafkacat. In this quick start, you'll learn how to use https://github.com/edenhill/kafkacat[Kafkacat^] to produce and consume messages for your Kafka instances in {product-kafka}.
126
+
Welcome to the quick start for {product-long-kafka} with Kcat. In this quick start, you'll learn how to use https://github.com/edenhill/kcat[Kcat^] to produce and consume messages for your Kafka instances in {product-kafka}.
130
127
====
131
128
endif::[]
132
129
133
130
[id="proc-configuring-kafkacat_{context}"]
134
-
== Configuring Kafkacat to connect to a Kafka instance
131
+
== Configuring Kcat to connect to a Kafka instance
135
132
136
133
[role="_abstract"]
137
-
To enable Kafkacat to access a Kafka instance, configure the connection using the bootstrap server endpoint for the instance and the generated credentials for your {product-kafka} service account. For Kafkacat, you can configure connection information either by passing options to the `kafkacat` command or by using a configuration file. The example in this task sets environment variables and then passes them to the `kafkacat` command.
134
+
To enable Kcat to access a Kafka instance, you must configure a connection. The configuration must include the bootstrap server endpoint for the Kafka instance and the credentials for your {product-long-kafka} service account.
138
135
139
-
For more information about Kafkacat configuration options, see https://github.com/edenhill/kafkacat#configuration[Configuration^] in the Kafkacat documentation.
136
+
You can either pass these values to the `kcat` command or use a configuration file. In this task, you set environment variable values and then pass them to the `kcat` command.
140
137
141
-
NOTE: Kafkacat does not yet fully support SASL/OAUTHBEARER authentication, so connecting to a Kafka instance requires only the bootstrap server and the service account credentials for SASL/PLAIN authentication.
138
+
For more information about Kcat configuration options, see https://github.com/edenhill/kcat#configuration[Configuration^] in the Kcat documentation.
142
139
143
-
NOTE: Kafkacat have been recently renamed to kcat. If you use latest version of kafkacat please replace all occurences referencing kafkacat binary to kcat
140
+
NOTE: Kcat does not yet fully support SASL/OAUTHBEARER authentication, which requires you to specify an access token in addition to service account credentials. Therefore, you use SASL/PLAIN authentication to connect to your Kafka instance with just service account credentials.
144
141
145
142
.Prerequisites
146
-
ifndef::qs[]
147
-
* You have the bootstrap server endpoint for your Kafka instance. To relocate the server endpoint, select your Kafka instance in the {product-kafka} web console, select the options menu (three vertical dots), and click *Connection*.
148
-
* You have the generated credentials for your service account. To reset the credentials, use the {service-accounts-url}[Service Accounts^] page in the *Application Services* section of the Red Hat Hybrid Cloud Console.
149
-
* You've set the permissions for your service account to access the Kafka instance resources. To verify the current permissions, select your Kafka instance in the {product-kafka} web console and use the *Access* page to find your service account permission settings.
150
-
endif::[]
143
+
* You have the bootstrap server endpoint for your Kafka instance. To get the server endpoint, select your Kafka instance in the {product-long-kafka} web console, select the options icon (three vertical dots), and click *Connection*.
144
+
* You have the generated credentials for your service account. To reset the credentials, use the {service-accounts-url}[Service Accounts^] page.
145
+
* You've set permissions for your service account to access resources in the Kafka instance. To verify the current permissions, select your Kafka instance in the {product-long-kafka} web console and click the *Access* tab. To learn more about setting permissions, see {base-url}{access-mgmt-url-kafka}[Managing account access in {product-long-kafka}^].
151
146
152
147
.Procedure
153
-
* On the command line, set the Kafka instance bootstrap server and client credentials as environment variables to be used by Kafkacat or other applications. Replace the values with your own server and credential information.
148
+
* On the command line, set the Kafka instance bootstrap server and client credentials as environment variables to be used by Kcat. Replace the values with your own server and credential information.
154
149
+
155
-
--
156
-
ifdef::qs[]
157
-
The `<bootstrap_server>` is the bootstrap server endpoint for your Kafka instance. The `<client_id>` and `<client_secret>` are the generated credentials for your service account. You copied this information previously for the Kafka instance in {product-kafka} by selecting the options menu (three vertical dots) and clicking *Connection*.
158
-
endif::[]
159
-
160
-
.Setting environment variables for server and credentials
150
+
.Setting environment variables for bootstrap server and client credentials
You can use Kafkacat to produce messages to Kafka topics in several ways, such as reading them from standard input (`stdin`) directly on the command line or from a file. This example produces messages from input on the command line. For more examples of Kafkacat producer messaging, see the https://github.com/edenhill/kafkacat#examples[Examples^] in the Kafkacat documentation.
162
+
You can use Kcat to produce messages to Kafka topics in several ways, such as reading them from standard input (`stdin`) on the command line, or from a file. In this task, you produce messages from input on the command line. For more examples of Kcat producer messaging, see https://github.com/edenhill/kcat#examples[Examples^] in the Kcat documentation.
174
163
175
164
.Prerequisites
176
-
* Kafkacat is installed.
177
-
* You have a running Kafka instance in {product-kafka}.
165
+
* Kcat is installed.
166
+
* You have a running Kafka instance in {product-long-kafka}.
167
+
* You have a topic in your Kafka instance that you can use to produce and consume messages.
178
168
* You've set the Kafka bootstrap server endpoint and your service account credentials as environment variables.
179
169
180
170
.Procedure
181
-
. On the command line, enter the following commands to start Kafkacat in _producer_ mode. This mode enables you to produce messages to your Kafka topic.
171
+
. On the command line, enter the following command to start Kcat in producer mode. This mode enables you to produce messages to your Kafka topic. Replace `_<kafka-topic>_` with your own topic name.
182
172
+
183
173
--
184
-
This example uses the SASL/PLAIN authentication mechanism with the server and credential environment variables that you set previously. This example produces messages to a topic in {product-kafka} named `my-first-kafka-topic`. Replace the topic name with the relevant topic as needed. The topic that you use in this command must already exist in {product-kafka}.
NOTE: {product-kafka} also supports the SASL/OAUTHBEARER mechanism for authentication, which is the recommended authentication mechanism to use. However, Kafkacat does not yet fully support OAUTHBEARER, so this example uses SASL/PLAIN.
183
+
NOTE: Kcat does not yet fully support SASL/OAUTHBEARER authentication, which requires you to specify an access token in addition to service account credentials. Therefore, you use SASL/PLAIN authentication to connect to your Kafka instance with just service account credentials.
196
184
197
-
NOTE: A Kafkacat producer might behave differently depending on the operating system. For example, on Mac operating systems, messages are sent by redirecting them to the Kafkacat binary in the format `echo "message" | kafkacat ...`.
185
+
NOTE: A Kcat producer might behave differently based on the operating system. For example, on Mac operating systems, messages are sent by redirecting them to the Kcat binary in the format `echo "message" | kcat ...`.
198
186
199
187
--
200
-
. With Kafkacat running in producer mode, enter messages into Kafkacat that you want to produce to the Kafka topic.
188
+
. With Kcat running in producer mode, enter messages that you want to produce to the Kafka topic, as shown in the following example:
201
189
+
202
-
.Example messages to produce to the Kafka topic
203
190
[source]
204
191
----
205
192
First message
206
193
Second message
207
194
Third message
208
195
----
209
-
. Keep this producer running to use later when you create a consumer.
196
+
. To finish producing the messages you entered, press `CTRL+D`.
197
+
. Keep the producer running so that you can use it again later, when you create a consumer.
198
+
+
199
+
NOTE: On Mac operating systems, pressing `CTRL+D` produces the messages you entered and then stops the producer. To use the producer again, you must restart it, as shown earlier in this task.
210
200
211
201
.Verification
212
202
ifdef::qs[]
@@ -217,55 +207,58 @@ ifndef::qs[]
217
207
endif::[]
218
208
219
209
[id="proc-consuming-messages-kafkacat_{context}"]
220
-
== Consuming messages in Kafkacat
210
+
== Consuming messages in Kcat
221
211
222
212
[role="_abstract"]
223
-
You can use Kafkacat to consume messages from Kafka topics. This example consumes the messages that you sent previously with the producer that you created with Kafkacat.
213
+
You can also use Kcat to consume messages from Kafka topics. In this task, you use Kcat to consume the messages that you previously produced to your topic.
224
214
225
215
.Prerequisites
226
-
* Kafkacat is installed.
227
-
* You have a running Kafka instance in {product-kafka}.
228
-
* You've set the Kafka bootstrap server endpoint and your service account credentials as environment variables.
229
-
* You used a producer to produce example messages to a topic.
216
+
* Kcat is installed.
217
+
* You have a running Kafka instance in {product-long-kafka}.
218
+
* You used Kcat to produce example messages to a topic in your Kafka instance.
230
219
231
220
.Procedure
232
-
. On the command line in a separate terminal from your producer, enter the following commands to start Kafkacat in _consumer_ mode. This mode enables you to consume messages from your Kafka topic.
221
+
. Open a second terminal window or tab, separate from your producer.
222
+
. On the command line, enter the following command to start Kcat in _consumer_ mode. This mode enables you to consume messages from your Kafka topic. Replace `_<kafka-topic>_` with the name of the topic that you previously produced messages to.
233
223
+
234
224
--
235
-
This example uses the SASL/PLAIN authentication mechanism with the server and credential environment variables that you set previously. This example consumes and displays the messages from the `my-first-kafka-topic` example topic, and states that it reached the end of partition `0` in the topic.
You see output that looks like the following example. The message values are the ones you previously sent using the producer.
235
+
236
+
[source,subs="+quotes"]
237
+
----
245
238
First message
246
239
Second message
247
240
Third message
248
-
% Reached end of topic my-first-kafka-topic [0] at offset 3
241
+
% Reached end of topic _<kafka-topic>_ [0] at offset 3
249
242
----
250
243
--
251
244
. If your producer is still running in a separate terminal, continue entering messages in the producer terminal and observe the messages being consumed in the consumer terminal.
252
245
253
-
NOTE: You can also use the {product-long-kafka} web console to browse messages in the Kafka topic. For more information, see {base-url}{message-browsing-url-kafka}[_Browsing messages in the {product-long-kafka} web console_^].
246
+
NOTE: You can also use the {product-kafka} web console to browse messages in the Kafka topic. For more information, see {base-url}{message-browsing-url-kafka}[Browsing messages in the {product-long-kafka} web console^].
254
247
255
248
.Verification
256
249
ifdef::qs[]
257
250
* Is your consumer running without any errors in the terminal?
258
-
* Did the consumer display the messages from the `my-first-kafka-topic` example topic?
251
+
* Did the consumer display the messages from your Kafka topic?
259
252
endif::[]
260
253
ifndef::qs[]
261
254
. Verify that your consumer is running without any errors in the terminal.
262
-
. Verify that the consumer displays the messages from the `my-first-kafka-topic` example topic.
255
+
. Verify that the consumer displays the messages from your Kafka topic.
263
256
endif::[]
264
257
265
258
ifdef::qs[]
266
259
[#conclusion]
267
260
====
268
-
Congratulations! You successfully completed the {product-kafka} Kafkacat quick start, and are now ready to produce and consume messages in the service.
261
+
Congratulations! You successfully completed the {product-kafka} Kcat quick start, and are now ready to produce and consume messages in the service.
Copy file name to clipboardExpand all lines: docs/registry/getting-started-registry/README.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -249,7 +249,7 @@ NOTE: HTTP Basic authentication is also available for tools and libraries that d
249
249
+
250
250
You’ll use the service account information that you saved to configure your applications to connect to your {registry} instances later when you're ready.
251
251
+
252
-
For example, if you plan to use https://github.com/edenhill/kafkacat[Kafkacat^] to interact with your Kafka instance and deserialize Avro messages using {registry}, you'll use this information to set your {registry} URL in the client environment variables.
252
+
For example, if you plan to use https://github.com/edenhill/kcat[Kcat^] to interact with your Kafka instance and deserialize Avro messages using {registry}, you'll use this information to set your {registry} URL in the client environment variables.
253
253
+
254
254
To review your service account information, reset your credentials, or delete the service account, use the left navigation menu to go to the *Service Accounts* page.
0 commit comments