proto | ||
src | ||
.dockerignore | ||
.gitignore | ||
.rustfmt.toml | ||
build.rs | ||
Cargo.lock | ||
Cargo.toml | ||
Dockerfile | ||
README.md |
PubSub client
Quick and easy
- run
sudo docker build -t client .
- run
sudo docker run --rm --network=host -it client publish topic message
- run
sudo docker run --rm --network=host -it client consume topic
With Cargo
- run
cargo build --release
- run
./target/release/client publish topic message
- run
./target/release/client consume topic
CLI
Note that there are a few changes in the CLI interface as opposed to what's in
the email. Please see --help
for details.
Examples (binary named client):
Publish a message
client publish mytopic mymessage
Consume a message (default timeout of 10s)
client consume mytopic
Consume a message with given timeout (seconds)
client consume mytopic -t 15
$ ./target/release/client --help
pubsub-rs 0.1.0
USAGE:
client [OPTIONS] <SUBCOMMAND>
OPTIONS:
-e, --endpoint <ENDPOINT> [default: localhost]
-h, --help Print help information
-p, --port <PORT> [default: 50051]
--protocol <PROTOCOL> [default: tcp] [possible values: http, tcp]
-V, --version Print version information
SUBCOMMANDS:
consume
help Print this message or the help of the given subcommand(s)
publish
Publish:
client-publish
USAGE:
client publish <TOPIC> <MESSAGE>
ARGS:
<TOPIC>
<MESSAGE>
OPTIONS:
-h, --help Print help information
Consume:
client-consume
USAGE:
client consume [OPTIONS] <TOPIC>
ARGS:
<TOPIC>
OPTIONS:
-h, --help Print help information
-t, --timeout <TIMEOUT> [default: 10]