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
{{ message }}
Repository navigation
Commit 4c8d0ed
Browse filesBrowse the repository at this point in the historyBrowse files
MINOR: Make Quickstart command examples copy-friendly (#23526)
This patch improves the copy usability of the Quickstart command
examples by ensuring copied commands can be pasted directly into a shell
without including prompts, terminal output, or interactive input.
Currently, some Bash code blocks mix executable commands with shell
prompts, terminal output, or interactive input. Since the website copy
button copies the entire code block, the copied content is not always
directly executable.
### Changes
- Remove `$` prompts from executable command blocks.
- Separate terminal output from executable commands.
- Separate interactive input from the console producer command.
This change is intentionally limited to the Quickstart so the formatting
approach can be reviewed before applying it more broadly.
Reviewers: Ming-Yen Chung <mingyen066@gmail.com>, Parker Chang
<parkerhiphop027@gmail.com>, Ken Huang <s7133700@gmail.com>
All of Kafka's command line tools have additional options: run the `kafka-topics.sh` command without any arguments to display usage information. For example, it can also show you [details such as the partition count](/{version}/getting-started/introduction/#main-concepts-and-terminology) of the new topic:
@@ -118,9 +123,14 @@ A Kafka client communicates with the Kafka brokers via the network for writing (
118
123
Run the console producer client to write a few events into your topic. By default, each line you enter will result in a separate event being written to the topic.
Then, start by creating some seed data to test with:
159
174
160
175
```bash
161
-
$ echo -e "foo
176
+
echo -e "foo
162
177
bar"> test.txt
163
178
```
164
179
165
180
Or on Windows:
166
181
167
182
```bash
168
-
$ echo foo > test.txt
169
-
$ echo bar >> test.txt
183
+
echo foo > test.txt
184
+
echo bar >> test.txt
170
185
```
171
186
172
187
Next, we'll start two connectors running in _standalone_ mode, which means they run in a single, local, dedicated process. We provide three configuration files as parameters. The first is always the configuration for the Kafka Connect process, containing common configuration such as the Kafka brokers to connect to and the serialization format for data. The remaining configuration files each specify a connector to create. These files include a unique connector name, the connector class to instantiate, and any other configuration required by the connector.
These sample configuration files, included with Kafka, use the default local cluster configuration you started earlier and create two connectors: the first is a source connector that reads lines from an input file and produces each to a Kafka topic and the second is a sink connector that reads messages from a Kafka topic and produces each as a line in an output file.
179
194
180
195
During startup you'll see a number of log messages, including some indicating that the connectors are being instantiated. Once the Kafka Connect process has started, the source connector should start reading lines from `test.txt` and producing them to the topic `connect-test`, and the sink connector should start reading messages from the topic `connect-test` and write them to the file `test.sink.txt`. We can verify the data has been delivered through the entire pipeline by examining the contents of the output file:
181
196
182
197
```bash
183
-
$ more test.sink.txt
198
+
more test.sink.txt
199
+
```
200
+
201
+
Example output:
202
+
203
+
```text
184
204
foo
185
205
bar
186
206
```
187
207
188
208
Note that the data is being stored in the Kafka topic `connect-test`, so we can also run a console consumer to see the data in the topic (or use custom consumer code to process it):
0 commit comments