-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the operation steps of RabbitMQ source connector. #839
Merged
Merged
Changes from 9 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
9babbca
The sample code of transaction is missing ".build()"
652c71d
Update admin-api-schemas.md
zhaoyajun2009 7a4ab54
Update txn-use.md
zhaoyajun2009 9d4dfbd
Add the opration steps of RabbitMQ source connector.
126b50a
Add the operation steps of RabbitMQ source connector.
d492cb7
Add the operation steps of RabbitMQ source connector.
221fadc
Merge branch 'rabbitmq-connector' of https://github.com/zhaoyajun2009…
c3c63f1
Add the operation steps of RabbitMQ source connector.
1a2702a
Update admin-api-schemas.md
zhaoyajun2009 4a8e9d5
Update io-rabbitmq-source.md
zhaoyajun2009 74a648d
Update io-rabbitmq-source.md
zhaoyajun2009 e271643
Update io-rabbitmq-source.md
zhaoyajun2009 f0281bf
Update io-rabbitmq-source.md
zhaoyajun2009 5919ec7
Update io-rabbitmq-source.md
zhaoyajun2009 72dc674
Update io-rabbitmq-source.md
zhaoyajun2009 81213c6
Update io-rabbitmq-source.md
zhaoyajun2009 2dd4c07
Update io-rabbitmq-source.md
zhaoyajun2009 077420b
Update io-rabbitmq-source.md
zhaoyajun2009 6299fce
Update io-rabbitmq-source.md
zhaoyajun2009 e5663b9
Update io-rabbitmq-source.md
zhaoyajun2009 9551955
Update docs/io-rabbitmq-source.md
zhaoyajun2009 d31918b
Update io-rabbitmq-source.md
zhaoyajun2009 ecb5fed
Update io-rabbitmq-source.md
zhaoyajun2009 e6fb0e7
Merge branch 'main' into rabbitmq-connector
visortelle b2708e9
Update io-rabbitmq-source.md
zhaoyajun2009 dfc6f2c
Update io-rabbitmq-source.md
zhaoyajun2009 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 |
---|---|---|
|
@@ -85,3 +85,104 @@ Before using the RabbitMQ source connector, you need to create a configuration f | |
passive: "false" | ||
``` | ||
|
||
## Usage | ||
|
||
|
||
### Standalone mode | ||
|
||
This example describes how to use the RabbitMQ source connector to feed data from RabbitMQ and write data to Pulsar topics in the standalone mode. | ||
|
||
#### Prerequisites | ||
|
||
- There is a RabbitMQ server with some history messages in the queue. | ||
|
||
#### Steps | ||
|
||
1. Get a Pulsar package and start Pulsar in standalone mode. | ||
|
||
```bash | ||
wget https://archive.apache.org/dist/pulsar/pulsar-@pulsar:version@/apache-pulsar-@pulsar:[email protected] | ||
tar xvfz apache-pulsar-@pulsar:[email protected] | ||
cd apache-pulsar-@pulsar:version@ | ||
bin/pulsar standalone | ||
``` | ||
|
||
2. Download the [nar package](https://archive.apache.org/dist/pulsar/) corresponding to Pulsar's version and copy the following file to Pulsar's directory. | ||
|
||
```bash | ||
wget https://archive.apache.org/dist/pulsar/pulsar-@pulsar:version@/connectors/pulsar-io-rabbitmq-@pulsar:[email protected] | ||
cp pulsar-io-rabbitmq-@pulsar:[email protected] ./connectors | ||
``` | ||
|
||
3. Set the retention of the namespace, otherwise the messages into the Pulsar's topic which have not the subscription ware immediately deleted. | ||
|
||
```bash | ||
./bin/pulsar-admin namespaces set-retention -s 100M -t 3d public/default | ||
``` | ||
|
||
|
||
4. Prepare a configuration file with name is _rabbitmq-source-queue-name.yaml_. | ||
```yaml | ||
configs: | ||
host: "localhost" | ||
port: 5672 | ||
virtualHost: "/" | ||
username: "guest" | ||
password: "guest" | ||
queueName: "test-queue" | ||
connectionName: "test-connection" | ||
requestedChannelMax: 0 | ||
requestedFrameMax: 0 | ||
connectionTimeout: 60000 | ||
handshakeTimeout: 10000 | ||
requestedHeartbeat: 60 | ||
prefetchCount: 0 | ||
prefetchGlobal: "false" | ||
passive: "false" | ||
``` | ||
|
||
Copy the configuration file to Pulsar‘s conf directory. | ||
```bash | ||
cp rabbitmq-source-queue-name.yaml ./conf | ||
``` | ||
|
||
5. Open a new terminal window and start the connector in local run mode. | ||
|
||
```bash | ||
./bin/pulsar-admin source localrun \ | ||
--source-config-file conf/rabbitmq-source-queue-name.yaml \ | ||
--archive connectors/pulsar-io-rabbitmq-@pulsar:[email protected] \ | ||
--name rabbitmq-source \ | ||
--destination-topic-name pulsar-rabbitmq-test-topic \ | ||
--broker-service-url pulsar://{ip}:{port} | ||
``` | ||
|
||
6. Open a new terminal window and check the topic is created automatically. | ||
|
||
```bash | ||
./bin/pulsar-admin topics list public/default \ | ||
``` | ||
|
||
This topic is created automatically as follows: | ||
|
||
```bash | ||
persistent://public/default/pulsar-rabbitmq-test-topic-partition-0 | ||
``` | ||
|
||
7. Consume this topic. | ||
|
||
```bash | ||
./bin/pulsar-client consume persistent://public/default/pulsar-rabbitmq-test-topic-partition-0 -s s1 -n 0 -p Earliest | ||
``` | ||
|
||
The following information appears on the consumer terminal window. | ||
|
||
```bash | ||
----- got message ----- | ||
key:[quick.orange.pulsar], properties:[], content:message-topic-O(range) 0 | ||
----- got message ----- | ||
key:[quick.orange.pulsar], properties:[], content:message-topic-O(range) 1 | ||
|
||
... ... | ||
|
||
``` |
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 |
---|---|---|
|
@@ -85,3 +85,104 @@ Before using the RabbitMQ source connector, you need to create a configuration f | |
|
||
``` | ||
|
||
## Usage | ||
|
||
|
||
### Standalone mode | ||
|
||
This example describes how to use the RabbitMQ source connector to feed data from RabbitMQ and write data to Pulsar topics in the standalone mode. | ||
|
||
#### Prerequisites | ||
|
||
- There is a RabbitMQ server with some history messages in the queue. | ||
|
||
#### Steps | ||
|
||
1. Get a Pulsar package and start Pulsar in standalone mode. | ||
|
||
```bash | ||
wget https://archive.apache.org/dist/pulsar/pulsar-@pulsar:version@/apache-pulsar-@pulsar:[email protected] | ||
tar xvfz apache-pulsar-@pulsar:[email protected] | ||
cd apache-pulsar-@pulsar:version@ | ||
bin/pulsar standalone | ||
``` | ||
|
||
2. Download the [nar package](https://archive.apache.org/dist/pulsar/) corresponding to Pulsar's version and copy the following file to Pulsar's directory. | ||
|
||
```bash | ||
wget https://archive.apache.org/dist/pulsar/pulsar-@pulsar:version@/connectors/pulsar-io-rabbitmq-@pulsar:[email protected] | ||
cp pulsar-io-rabbitmq-@pulsar:[email protected] ./connectors | ||
``` | ||
|
||
3. Set the retention of the namespace, otherwise the messages into the Pulsar's topic which have not the subscription ware immediately deleted. | ||
|
||
```bash | ||
./bin/pulsar-admin namespaces set-retention -s 100M -t 3d public/default | ||
``` | ||
|
||
|
||
4. Prepare a configuration file with name is _rabbitmq-source-queue-name.yaml_. | ||
```yaml | ||
configs: | ||
host: "localhost" | ||
port: 5672 | ||
virtualHost: "/" | ||
username: "guest" | ||
password: "guest" | ||
queueName: "test-queue" | ||
connectionName: "test-connection" | ||
requestedChannelMax: 0 | ||
requestedFrameMax: 0 | ||
connectionTimeout: 60000 | ||
handshakeTimeout: 10000 | ||
requestedHeartbeat: 60 | ||
prefetchCount: 0 | ||
prefetchGlobal: "false" | ||
passive: "false" | ||
``` | ||
|
||
Copy the configuration file to Pulsar‘s conf directory. | ||
```bash | ||
cp rabbitmq-source-queue-name.yaml ./conf | ||
``` | ||
|
||
5. Open a new terminal window and start the connector in local run mode. | ||
|
||
```bash | ||
./bin/pulsar-admin source localrun \ | ||
--source-config-file conf/rabbitmq-source-queue-name.yaml \ | ||
--archive connectors/pulsar-io-rabbitmq-@pulsar:[email protected] \ | ||
--name rabbitmq-source \ | ||
--destination-topic-name pulsar-rabbitmq-test-topic \ | ||
--broker-service-url pulsar://{ip}:{port} | ||
``` | ||
|
||
6. Open a new terminal window and check the topic is created automatically. | ||
|
||
```bash | ||
./bin/pulsar-admin topics list public/default \ | ||
``` | ||
|
||
This topic is created automatically as follows: | ||
|
||
```bash | ||
persistent://public/default/pulsar-rabbitmq-test-topic-partition-0 | ||
``` | ||
|
||
7. Consume this topic. | ||
|
||
```bash | ||
./bin/pulsar-client consume persistent://public/default/pulsar-rabbitmq-test-topic-partition-0 -s s1 -n 0 -p Earliest | ||
``` | ||
|
||
The following information appears on the consumer terminal window. | ||
|
||
```bash | ||
----- got message ----- | ||
key:[quick.orange.pulsar], properties:[], content:message-topic-O(range) 0 | ||
----- got message ----- | ||
key:[quick.orange.pulsar], properties:[], content:message-topic-O(range) 1 | ||
|
||
... ... | ||
|
||
``` |
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 |
---|---|---|
|
@@ -85,3 +85,104 @@ Before using the RabbitMQ source connector, you need to create a configuration f | |
passive: "false" | ||
``` | ||
|
||
## Usage | ||
|
||
|
||
### Standalone mode | ||
|
||
This example describes how to use the RabbitMQ source connector to feed data from RabbitMQ and write data to Pulsar topics in the standalone mode. | ||
|
||
#### Prerequisites | ||
|
||
- There is a RabbitMQ server with some history messages in the queue. | ||
|
||
#### Steps | ||
|
||
1. Get a Pulsar package and start Pulsar in standalone mode. | ||
|
||
```bash | ||
wget https://archive.apache.org/dist/pulsar/pulsar-@pulsar:version@/apache-pulsar-@pulsar:[email protected] | ||
tar xvfz apache-pulsar-@pulsar:[email protected] | ||
cd apache-pulsar-@pulsar:version@ | ||
bin/pulsar standalone | ||
``` | ||
|
||
2. Download the [nar package](https://archive.apache.org/dist/pulsar/) corresponding to Pulsar's version and copy the following file to Pulsar's directory. | ||
|
||
```bash | ||
wget https://archive.apache.org/dist/pulsar/pulsar-@pulsar:version@/connectors/pulsar-io-rabbitmq-@pulsar:[email protected] | ||
cp pulsar-io-rabbitmq-@pulsar:[email protected] ./connectors | ||
``` | ||
|
||
3. Set the retention of the namespace, otherwise the messages into the Pulsar's topic which have not the subscription ware immediately deleted. | ||
|
||
```bash | ||
./bin/pulsar-admin namespaces set-retention -s 100M -t 3d public/default | ||
``` | ||
|
||
|
||
4. Prepare a configuration file with name is _rabbitmq-source-queue-name.yaml_. | ||
```yaml | ||
configs: | ||
host: "localhost" | ||
port: 5672 | ||
virtualHost: "/" | ||
username: "guest" | ||
password: "guest" | ||
queueName: "test-queue" | ||
connectionName: "test-connection" | ||
requestedChannelMax: 0 | ||
requestedFrameMax: 0 | ||
connectionTimeout: 60000 | ||
handshakeTimeout: 10000 | ||
requestedHeartbeat: 60 | ||
prefetchCount: 0 | ||
prefetchGlobal: "false" | ||
passive: "false" | ||
``` | ||
|
||
Copy the configuration file to Pulsar‘s conf directory. | ||
```bash | ||
cp rabbitmq-source-queue-name.yaml ./conf | ||
``` | ||
|
||
5. Open a new terminal window and start the connector in local run mode. | ||
|
||
```bash | ||
./bin/pulsar-admin source localrun \ | ||
--source-config-file conf/rabbitmq-source-queue-name.yaml \ | ||
--archive connectors/pulsar-io-rabbitmq-@pulsar:[email protected] \ | ||
--name rabbitmq-source \ | ||
--destination-topic-name pulsar-rabbitmq-test-topic \ | ||
--broker-service-url pulsar://{ip}:{port} | ||
``` | ||
|
||
6. Open a new terminal window and check the topic is created automatically. | ||
|
||
```bash | ||
./bin/pulsar-admin topics list public/default \ | ||
``` | ||
|
||
This topic is created automatically as follows: | ||
|
||
```bash | ||
persistent://public/default/pulsar-rabbitmq-test-topic-partition-0 | ||
``` | ||
|
||
7. Consume this topic. | ||
|
||
```bash | ||
./bin/pulsar-client consume persistent://public/default/pulsar-rabbitmq-test-topic-partition-0 -s s1 -n 0 -p Earliest | ||
``` | ||
|
||
The following information appears on the consumer terminal window. | ||
|
||
```bash | ||
----- got message ----- | ||
key:[quick.orange.pulsar], properties:[], content:message-topic-O(range) 0 | ||
----- got message ----- | ||
key:[quick.orange.pulsar], properties:[], content:message-topic-O(range) 1 | ||
|
||
... ... | ||
|
||
``` |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is "ware" a typo here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry,it has been solved。