You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by si...@apache.org on 2019/01/15 15:06:45 UTC
[pulsar] branch master updated: Add a consumer example in
deploy-bare-metal doc for a new beginner. (#3372)
This is an automated email from the ASF dual-hosted git repository.
sijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new 49a271f Add a consumer example in deploy-bare-metal doc for a new beginner. (#3372)
49a271f is described below
commit 49a271f0be2b6a0e2a0776f3876c604b629f459c
Author: Fangbin Sun <su...@gmail.com>
AuthorDate: Tue Jan 15 23:06:39 2019 +0800
Add a consumer example in deploy-bare-metal doc for a new beginner. (#3372)
### Motivation
It is better to add a consumer example in deploying a pulsar cluster for new beginners.
### Modifications
Amend a typo in pulsar-client producer example and add a consumer example.
---
site2/docs/deploy-bare-metal.md | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/site2/docs/deploy-bare-metal.md b/site2/docs/deploy-bare-metal.md
index 42ba5d2..f1780f6 100644
--- a/site2/docs/deploy-bare-metal.md
+++ b/site2/docs/deploy-bare-metal.md
@@ -389,12 +389,27 @@ Once you've done that, you can publish a message to Pulsar topic:
$ bin/pulsar-client produce \
persistent://public/default/test \
-n 1 \
- -m "Hello, Pulsar"
+ -m "Hello Pulsar"
```
> You may need to use a different cluster name in the topic if you specified a cluster name different from `pulsar-cluster-1`.
-This will publish a single message to the Pulsar topic.
+This will publish a single message to the Pulsar topic. In addition, you can subscribe the Pulsar topic in a different terminal before publishing messages as below:
+
+```bash
+$ bin/pulsar-client consume \
+ persistent://public/default/test \
+ -n 100 \
+ -s "consumer-test" \
+ -t "Exclusive"
+```
+
+Once the message above has been successfully published to the topic, you should see it in the standard output:
+
+```bash
+----- got message -----
+Hello Pulsar
+```
## Running Functions