Skip to content

Commit c077710

Browse files
authored
Wrap console instructions to improve readability (#253)
1 parent 2f39b5d commit c077710

2 files changed

Lines changed: 106 additions & 22 deletions

File tree

Container-README.md

Lines changed: 100 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ An extension to [ServiceControl](https://docs.particular.net/servicecontrol) tha
55
## How to use this image
66

77
This extension currently supports both RabbitMQ and Azure Service Bus brokers.
8-
In order to successfully run this extension, you need to first run the ServiceControl container. Read more about the ServiceControl [image](https://hub.docker.com/r/particular/servicecontrol).
8+
In order to successfully run this extension, you need to first run the ServiceControl container. Read more about the [ServiceControl image](https://hub.docker.com/r/particular/servicecontrol).
99

1010
### 1. Setup the connector
1111

@@ -16,11 +16,21 @@ Before the connector can be run, the connector needs:
1616

1717
To do this you need to run the container with the `--run-mode setup` option:
1818
```shell
19-
docker run -e TRANSPORT_TYPE=<RabbitMQ|AzureServiceBus|AzureServiceBusWithDeadLetter> -e CONNECTION_STRING=<connection string> --rm particular/servicecontrol-masstransit-connector:latest --run-mode setup
19+
docker run \
20+
-e TRANSPORT_TYPE=<RabbitMQ|AzureServiceBus|AzureServiceBusWithDeadLetter> \
21+
-e CONNECTION_STRING=<connection string> \
22+
--rm \
23+
particular/servicecontrol-masstransit-connector:latest \
24+
--run-mode setup
2025
```
2126
Followed by the `queues-list` command:
2227
```shell
23-
docker run -e TRANSPORT_TYPE=<RabbitMQ|AzureServiceBus|AzureServiceBusWithDeadLetter> -e CONNECTION_STRING=<connection string> --rm particular/servicecontrol-masstransit-connector:latest queues-list
28+
docker run \
29+
-e TRANSPORT_TYPE=<RabbitMQ|AzureServiceBus|AzureServiceBusWithDeadLetter> \
30+
-e CONNECTION_STRING=<connection string> \
31+
--rm \
32+
particular/servicecontrol-masstransit-connector:latest \
33+
queues-list
2434
```
2535

2636
The `queues-list` command will output onto the console a list of applicable queues that have been found in the broker.
@@ -31,24 +41,63 @@ By default, we only list the queues that end with `_error` (the default naming c
3141
Assuming a RabbitMQ message broker is also hosted in a Docker container. Replace the &lt;port&gt;, &lt;username&gt; and &lt;password&gt; sections with their respective values.
3242

3343
```shell
34-
docker run -e TRANSPORT_TYPE=RabbitMQ -e CONNECTION_STRING=host=host.docker.internal -e RABBITMQ_MANAGEMENT_API_URL=http://host.docker.internal:<port> -e RABBITMQ_MANAGEMENT_API_USERNAME=<username> -e RABBITMQ_MANAGEMENT_API_PASSWORD=<password> --rm particular/servicecontrol-masstransit-connector:latest --run-mode setup
35-
docker run -e TRANSPORT_TYPE=RabbitMQ -e CONNECTION_STRING=host=host.docker.internal -e RABBITMQ_MANAGEMENT_API_URL=http://host.docker.internal:<port> -e RABBITMQ_MANAGEMENT_API_USERNAME=<username> -e RABBITMQ_MANAGEMENT_API_PASSWORD=<password> --rm particular/servicecontrol-masstransit-connector:latest queues-list > queues.txt
44+
docker run \
45+
-e TRANSPORT_TYPE=RabbitMQ \
46+
-e CONNECTION_STRING=host=host.docker.internal \
47+
-e RABBITMQ_MANAGEMENT_API_URL=http://host.docker.internal:<port> \
48+
-e RABBITMQ_MANAGEMENT_API_USERNAME=<username> \
49+
-e RABBITMQ_MANAGEMENT_API_PASSWORD=<password> \
50+
--rm \
51+
particular/servicecontrol-masstransit-connector:latest \
52+
--run-mode setup
53+
54+
docker run \
55+
-e TRANSPORT_TYPE=RabbitMQ \
56+
-e CONNECTION_STRING=host=host.docker.internal \
57+
-e RABBITMQ_MANAGEMENT_API_URL=http://host.docker.internal:<port> \
58+
-e RABBITMQ_MANAGEMENT_API_USERNAME=<username> \
59+
-e RABBITMQ_MANAGEMENT_API_PASSWORD=<password> \
60+
--rm \
61+
particular/servicecontrol-masstransit-connector:latest \
62+
queues-list > queues.txt
3663
```
3764

3865
#### Example of an Azure Service Bus setup
3966

4067
```shell
41-
docker run -e TRANSPORT_TYPE=AzureServiceBus -e CONNECTION_STRING=Endpoint=sb://[NAMESPACE].servicebus.windows.net/;SharedAccessKeyName=[KEYNAME];SharedAccessKey=[KEY] --rm particular/servicecontrol-masstransit-connector:latest --run-mode setup
42-
docker run -e TRANSPORT_TYPE=AzureServiceBus -e CONNECTION_STRING=Endpoint=sb://[NAMESPACE].servicebus.windows.net/;SharedAccessKeyName=[KEYNAME];SharedAccessKey=[KEY] --rm particular/servicecontrol-masstransit-connector:latest queues-list > queues.txt
68+
docker run \
69+
-e TRANSPORT_TYPE=AzureServiceBus \
70+
-e CONNECTION_STRING=Endpoint=sb://[NAMESPACE].servicebus.windows.net/;SharedAccessKeyName=[KEYNAME];SharedAccessKey=[KEY] \
71+
--rm \
72+
particular/servicecontrol-masstransit-connector:latest \
73+
--run-mode setup
74+
75+
docker run \
76+
-e TRANSPORT_TYPE=AzureServiceBus \
77+
-e CONNECTION_STRING=Endpoint=sb://[NAMESPACE].servicebus.windows.net/;SharedAccessKeyName=[KEYNAME];SharedAccessKey=[KEY] \
78+
--rm \
79+
particular/servicecontrol-masstransit-connector:latest \
80+
queues-list > queues.txt
4381
```
4482

4583
#### Example of an Azure Service Bus with Dead Letter enabled setup
4684

4785
Using the `--filter` option.
4886

4987
```shell
50-
docker run -e TRANSPORT_TYPE=AzureServiceBusWithDeadLetter -e CONNECTION_STRING=Endpoint=sb://[NAMESPACE].servicebus.windows.net/;SharedAccessKeyName=[KEYNAME];SharedAccessKey=[KEY] --rm particular/servicecontrol-masstransit-connector:latest --run-mode setup
51-
docker run -e TRANSPORT_TYPE=AzureServiceBusWithDeadLetter -e CONNECTION_STRING=Endpoint=sb://[NAMESPACE].servicebus.windows.net/;SharedAccessKeyName=[KEYNAME];SharedAccessKey=[KEY] --rm particular/servicecontrol-masstransit-connector:latest queues-list --filter "^production_.*" > queues.txt
88+
docker run \
89+
-e TRANSPORT_TYPE=AzureServiceBusWithDeadLetter \
90+
-e CONNECTION_STRING=Endpoint=sb://[NAMESPACE].servicebus.windows.net/;SharedAccessKeyName=[KEYNAME];SharedAccessKey=[KEY] \
91+
--rm \
92+
particular/servicecontrol-masstransit-connector:latest \
93+
--run-mode setup
94+
95+
docker run \
96+
-e TRANSPORT_TYPE=AzureServiceBusWithDeadLetter \
97+
-e CONNECTION_STRING=Endpoint=sb://[NAMESPACE].servicebus.windows.net/;SharedAccessKeyName=[KEYNAME];SharedAccessKey=[KEY] \
98+
--rm \
99+
particular/servicecontrol-masstransit-connector:latest \
100+
queues-list --filter "^production_.*" > queues.txt
52101
```
53102

54103
### 2. Configure error queues to monitor
@@ -63,27 +112,52 @@ From the previous step, we have piped the list of error queues output to the con
63112
The last step is to map the queues text file to the docker container `-v [local_path_to_queues_file]:/app/queues.txt:ro`, then run the connector to bridge MassTransit errors queues with the Particular Platform.
64113

65114
```shell
66-
docker run -e TRANSPORT_TYPE=<RabbitMQ|AzureServiceBus|AzureServiceBusWithDeadLetter> -e CONNECTION_STRING=<connection string> -v [local_path_to_queues_file]:/app/queues.txt:ro particular/servicecontrol-masstransit-connector:latest --run-mode run
115+
docker run \
116+
-e TRANSPORT_TYPE=<RabbitMQ|AzureServiceBus|AzureServiceBusWithDeadLetter> \
117+
-e CONNECTION_STRING=<connection string> \
118+
-v [local_path_to_queues_file]:/app/queues.txt:ro \
119+
particular/servicecontrol-masstransit-connector:latest \
120+
--run-mode run
67121
```
68122

69123
#### Example of running with RabbitMQ
70124

71125
Assuming a RabbitMQ message broker is also hosted in a Docker container. Replace the &lt;port&gt;, &lt;username&gt; and &lt;password&gt; sections with their respective values.
72126

73127
```shell
74-
docker run -e TRANSPORT_TYPE=RabbitMQ -e CONNECTION_STRING=host=host.docker.internal -e RABBITMQ_MANAGEMENT_API_URL=http://host.docker.internal:<port> -e RABBITMQ_MANAGEMENT_API_USERNAME=<username> -e RABBITMQ_MANAGEMENT_API_PASSWORD=<password> -v $(pwd)/queues.txt:/app/queues.txt:ro particular/servicecontrol-masstransit-connector:latest --run-mode run
128+
docker run \
129+
-e TRANSPORT_TYPE=RabbitMQ \
130+
-e CONNECTION_STRING=host=host.docker.internal \
131+
-e RABBITMQ_MANAGEMENT_API_URL=http://host.docker.internal:<port> \
132+
-e RABBITMQ_MANAGEMENT_API_USERNAME=<username> \
133+
-e RABBITMQ_MANAGEMENT_API_PASSWORD=<password> \
134+
-v $(pwd)/queues.txt:/app/queues.txt:ro \
135+
particular/servicecontrol-masstransit-connector:latest \
136+
--run-mode run
75137
```
76138

77139
#### Example of running with Azure Service Bus
78140

79141
```shell
80-
docker run -e TRANSPORT_TYPE=AzureServiceBus -e CONNECTION_STRING=Endpoint=sb://[NAMESPACE].servicebus.windows.net/;SharedAccessKeyName=[KEYNAME];SharedAccessKey=[KEY] -v $(pwd)/queues.txt:/app/queues.txt:ro --rm particular/servicecontrol-masstransit-connector:latest --run-mode run
142+
docker run \
143+
-e TRANSPORT_TYPE=AzureServiceBus \
144+
-e CONNECTION_STRING=Endpoint=sb://[NAMESPACE].servicebus.windows.net/;SharedAccessKeyName=[KEYNAME];SharedAccessKey=[KEY] \
145+
-v $(pwd)/queues.txt:/app/queues.txt:ro \
146+
--rm \
147+
particular/servicecontrol-masstransit-connector:latest \
148+
--run-mode run
81149
```
82150

83151
#### Example of running with Azure Service Bus with Dead Letter enabled
84152

85153
```shell
86-
docker run -e TRANSPORT_TYPE=AzureServiceBusWithDeadLetter -e CONNECTION_STRING=Endpoint=sb://[NAMESPACE].servicebus.windows.net/;SharedAccessKeyName=[KEYNAME];SharedAccessKey=[KEY] -v $(pwd)/queues.txt:/app/queues.txt:ro --rm particular/servicecontrol-masstransit-connector:latest --run-mode run
154+
docker run \
155+
-e TRANSPORT_TYPE=AzureServiceBusWithDeadLetter \
156+
-e CONNECTION_STRING=Endpoint=sb://[NAMESPACE].servicebus.windows.net/;SharedAccessKeyName=[KEYNAME];SharedAccessKey=[KEY] \
157+
-v $(pwd)/queues.txt:/app/queues.txt:ro \
158+
--rm \
159+
particular/servicecontrol-masstransit-connector:latest \
160+
--run-mode run
87161
```
88162

89163
## Refreshing the errors queue text file
@@ -92,7 +166,12 @@ The `queues-list` command can be run when you need to update the list of error q
92166
The text file containing queue names can be updated without bringing down the container.
93167

94168
```shell
95-
docker run -e TRANSPORT_TYPE=<RabbitMQ|AzureServiceBus|AzureServiceBusWithDeadLetter> -e CONNECTION_STRING=<connection string> --rm particular/servicecontrol-masstransit-connector:latest queues-list
169+
docker run \
170+
-e TRANSPORT_TYPE=<RabbitMQ|AzureServiceBus|AzureServiceBusWithDeadLetter> \
171+
-e CONNECTION_STRING=<connection string> \
172+
--rm \
173+
particular/servicecontrol-masstransit-connector:latest \
174+
queues-list
96175
```
97176

98177
This will output the list of all queues that end with `_error` (you can specify a different filter by using `--filter <regular expression>`).
@@ -137,11 +216,13 @@ Once you have received a license from Particular, there are two options to insta
137216

138217
Currently supported are the most used MassTransit transports: RabbitMQ and Azure Service Bus.
139218

140-
| Description | Key | Notes |
141-
|-------------------|--------------------------------------| --- |
142-
| Azure Service Bus | `AzureServiceBus` | |
143-
| Azure Service Bus with Dead Letter | `AzureServiceBusWithDeadLetter` | Azure Service Bus configured to ingest from [dead-letter queues](https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-dead-letter-queues). |
144-
| RabbitMQ | `RabbitMQ` | |
219+
| Description | Key | Notes |
220+
|------------------------------------|---------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|
221+
| Azure Service Bus | `AzureServiceBus` | |
222+
| Azure Service Bus with Dead Letter | `AzureServiceBusWithDeadLetter` | Azure Service Bus configured to ingest from [dead-letter queues](https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-dead-letter-queues). |
223+
| RabbitMQ | `RabbitMQ` | |
224+
225+
145226

146227

147228
### CONNECTION_STRING

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A ServiceControl container image that adds support for processing [MassTransit](
44

55
## Installation
66

7-
The connector is container image which is **Linux Arm64** and **Linux Amd64** compatible. The image is available at https://hub.docker.com/r/particular/servicecontrol-masstransit-connector . Please read the docker hub README for more information on available tags and container usage.
7+
The connector is container image which is **Linux Arm64** and **Linux Amd64** compatible. The image is available at <https://hub.docker.com/r/particular/servicecontrol-masstransit-connector> . Please read the docker hub README for more information on available tags and container usage.
88

99
## Prerequisites
1010

@@ -28,12 +28,15 @@ dotnet build src/ServiceControl.Connector.MassTransit.sln
2828
> The following creates a multiplatform images. This can only be build when the "Use containerd for pulling and storing images" is enabled under General.
2929
3030
> [!NOTE]
31-
> The dockerfile is also compatible with https://podman.io/, replace `docker buildx build` with `podman build`.
31+
> The dockerfile is also compatible with <https://podman.io/>, replace `docker buildx build` with `podman build`.
3232
3333
To locally build and test the container run the following in any shell:
3434

3535
```shell
36-
docker buildx build --file src/ServiceControl.Connector.MassTransit.Host/Dockerfile --platform linux/arm64,linux/amd64 --tag particular/servicecontrol-masstransit-connector:latest .
36+
docker buildx build \
37+
--file src/ServiceControl.Connector.MassTransit.Host/Dockerfile \
38+
--platform linux/arm64,linux/amd64 \
39+
--tag particular/servicecontrol-masstransit-connector:latest .
3740
```
3841
### Troubleshooting
3942

0 commit comments

Comments
 (0)