Skip to content

Commit

Permalink
Provide embedded documentation
Browse files Browse the repository at this point in the history
Fixes jlandersen#35

Signed-off-by: azerr <[email protected]>
  • Loading branch information
angelozerr committed Jan 12, 2021
1 parent 87fe68d commit aa33f82
Show file tree
Hide file tree
Showing 11 changed files with 1,032 additions and 6 deletions.
10 changes: 10 additions & 0 deletions docs/Consuming.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Consuming

Consuming topics can be done by right clicking a topic in the explorer or from the command palette. Some things to note about consuming:

* UTF-8 encoded keys and values only. If data is encoded differently, it will not be pretty.
* One consumer group is created per topic (may change in the future to just have one for the extension).

Consumers are based on virtual documents, available in the VS Code extension API. A consumer will keep running even if you close the document in the editor. You should make sure to close the consumer explicitly, either via the command palette, the status bar element or the start/stop action button as well. The VS Code API does not support detecting if a virtual document is closed immediately. Instead, the underlying virtual document is automatically closed after two minutes if the document is closed in the editor.

You can configure start offset for new consumers in settings (earliest, latest).
Empty file added docs/Explorer.md
Empty file.
25 changes: 25 additions & 0 deletions docs/Producing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Producing

Producing can be done by creating a `.kafka` file. Write simple producers using the following format:

```json
PRODUCER keyed-message
topic: my-topic
key: mykeyq
record content

###

PRODUCER non-keyed-json-message
topic: json-events
{
"type": "my_test_event"
}
```

For actually producing a single record, click on the "Produce record" link above the PRODUCER line; for producing 10 records, click on "Produce record x 10".
The log about produced messages is printed in the "Kafka Producer Log" Output view.

Record content can be randomized by injecting mustache-like placeholders of [faker.js properties](https://github.com/Marak/faker.js#api-methods), like ``{{name.lastName}}`` or ``{{random.number}}``. Some randomized properties can be localized via the `kafka.producers.fakerjs.locale` setting.

![Screenshot-4](assets/screen-4.png)
7 changes: 7 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# VSCode Kafka Documentation

Welcome to the [vscode-kafka](https://github.com/jlandersen/vscode-kafka) documentation.

* [Kafka Explorer](Explorer.md#explorer)
* [Producing](Producing.md#producing)
* [Consuming](Consuming.md#consuming)
Loading

0 comments on commit aa33f82

Please sign in to comment.