-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
129 additions
and
57 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Danube-Pubsub CLI - Consume messages | ||
|
||
The `consume` command retrieves messages from a specified topic. | ||
|
||
## Usage | ||
|
||
```bash | ||
danube-pubsub consume [OPTIONS] --service-addr <SERVICE_ADDR> --subscription <SUBSCRIPTION> | ||
``` | ||
|
||
### Options | ||
|
||
- `-s, --service-addr <SERVICE_ADDR>` | ||
**Description:** The service URL for the Danube broker. | ||
**Example:** `http://127.0.0.1:6650` | ||
|
||
- `-t, --topic <TOPIC>` | ||
**Description:** The topic to consume messages from. | ||
**Default:** `/default/test_topic` | ||
|
||
- `-c, --consumer <CONSUMER>` | ||
**Description:** The consumer name. | ||
**Default:** `consumer_pubsub` | ||
|
||
- `-m, --subscription <SUBSCRIPTION>` | ||
**Description:** The subscription name. | ||
**Required:** Yes | ||
|
||
- `--sub-type <SUB_TYPE>` | ||
**Description:** The subscription type. | ||
**Default:** `shared` | ||
**Possible values:** `exclusive`, `shared`, `fail-over` | ||
|
||
- `-h, --help` | ||
**Description:** Print help information. | ||
|
||
### Example: Shared Subscription | ||
|
||
To receive messages from a shared subscription: | ||
|
||
```bash | ||
danube-pubsub consume -s http://127.0.0.1:6650 -m my_shared_subscription | ||
``` | ||
|
||
### Example: Exclusive Subscription | ||
|
||
To receive messages from an exclusive subscription: | ||
|
||
```bash | ||
danube-pubsub consume -s http://127.0.0.1:6650 -m my_exclusive --sub-type exclusive | ||
``` | ||
|
||
**To create a new exclusive subscription:** | ||
|
||
```bash | ||
danube-pubsub consume -s http://127.0.0.1:6650 -m my_exclusive2 --sub-type exclusive | ||
``` | ||
|
||
## Resources | ||
|
||
Check [this article](https://dev-state.com/posts/danube_pubsub/) that covers how to combine the subscription types in order to obtain message queueing or fan-out pub-sub messaging patterns. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Danube-Pubsub CLI - Produce messages | ||
|
||
The `produce` command sends messages to a specified topic. | ||
|
||
## Usage | ||
|
||
```bash | ||
danube-pubsub produce [OPTIONS] --service-addr <SERVICE_ADDR> --message <MESSAGE> | ||
``` | ||
|
||
### Options | ||
|
||
- `-s, --service-addr <SERVICE_ADDR>` | ||
**Description:** The service URL for the Danube broker. | ||
**Example:** `http://127.0.0.1:6650` | ||
|
||
- `-t, --topic <TOPIC>` | ||
**Description:** The topic to produce messages to. | ||
**Default:** `/default/test_topic` | ||
|
||
- `-p, --schema <SCHEMA>` | ||
**Description:** The schema type of the message. | ||
**Possible values:** `bytes`, `string`, `int64`, `json` | ||
|
||
- `-m, --message <MESSAGE>` | ||
**Description:** The message to send. | ||
**Required:** Yes | ||
|
||
- `--json-schema <JSON_SCHEMA>` | ||
**Description:** The JSON schema, required if schema type is `json`. | ||
|
||
- `-c, --count <COUNT>` | ||
**Description:** Number of times to send the message. | ||
**Default:** `1` | ||
|
||
- `-i, --interval <INTERVAL>` | ||
**Description:** Interval between messages in milliseconds. | ||
**Default:** `500` | ||
**Minimum:** `100` | ||
|
||
- `-a, --attributes <ATTRIBUTES>` | ||
**Description:** Attributes in the form `'parameter:value'`. | ||
**Example:** `'key1:value1,key2:value2'` | ||
|
||
- `-h, --help` | ||
**Description:** Print help information | ||
|
||
### Example | ||
|
||
To send 1000 messages with the content "Hello, Danube!" to the default topic: | ||
|
||
```bash | ||
danube-pubsub produce -s http://127.0.0.1:6650 -c 1000 -m "Hello, Danube!" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters