Skip to content

Commit 2e2e87f

Browse files
committed
updated the readme and docker base
1 parent 7610ee3 commit 2e2e87f

File tree

3 files changed

+51
-19
lines changed

3 files changed

+51
-19
lines changed

README.md

Lines changed: 49 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,73 @@
11
# MassTransitShowcaseDemo
22

3-
A MassTransit version of the [NServiceBus Monitoring Demo](https://github.com/Particular/MonitoringDemo/)
43

54
## Launching the Particular Platform for MassTransit
5+
To run the code sample you have 3 options in terms of transports:
66

7-
To launch using **RabbitMQ**:
7+
## **RabbitMQ**
8+
9+
>[!NOTE]
10+
The RabbitMQ Broker is started as part of the docker compose process
11+
>
12+
13+
Run docker command bellow from the `src` folder in a CLI
814
```cmd
9-
cd src
1015
docker compose -f docker-compose-base.yml -f compose-rabbitmq.yml --env-file rabbit.env up -d
1116
```
17+
## **Azure ServiceBus**
1218

13-
To launch using **Amazon SQS**:
19+
Configure the access to your Azure Service Bus namespace by editing the variables in `asb.env`
1420

15-
First you need to update the variables in `sqs.env` with all the account details and then
1621
```cmd
17-
cd src
18-
docker compose -f docker-compose-base.yml -f compose-sqs.yml --env-file sqs.env up -d
22+
CONNECTIONSTRING="Endpoint=sb://[NAMESPACE].servicebus.windows.net/;SharedAccessKeyName=[KEYNAME];SharedAccessKey=[KEY]"
1923
```
2024

21-
To launch using **Azure ServiceBus**:
25+
Set the same environment variables on your machine:
26+
27+
```cmd
28+
setx CONNECTIONSTRING_AZURESERVICEBUS "Endpoint=sb://[NAMESPACE].servicebus.windows.net/;SharedAccessKeyName=[KEYNAME];SharedAccessKey=[KEY]"
29+
```
30+
31+
Run docker command bellow from the `src` folder in a CLI
2232

23-
First you need to update the variables in `asb.env` with all the account details and then
2433
```cmd
25-
cd src
2634
docker compose -f docker-compose-base.yml -f compose-azure.yml --env-file asb.env up -d
2735
```
2836

29-
## Prerequisites
37+
## **Amazon SQS**
38+
39+
Configure the access to your SQS namespace by editing the variables in `sqs.env`
40+
41+
```cmd
42+
AWS_REGION="<region>"
43+
AWS_ACCESS_KEY_ID="<access-key>"
44+
AWS_SECRET_ACCESS_KEY="<secret-access-key>"
45+
```
46+
47+
Set the same environment variables on your machine:
3048

31-
- Have "Enable Multi-Project Launch profiles" enabled
49+
```cmd
50+
setx AWS_REGION "<region>"
51+
setx AWS_ACCESS_KEY_ID "<access-key>"
52+
setx AWS_SECRET_ACCESS_KEY "<secret-access-key>"
53+
```
3254

33-
### Enable Multi-Project Launch profiles
55+
Run docker command bellow from the `src` folder in a CLI
56+
57+
```cmd
58+
docker compose -f docker-compose-base.yml -f compose-sqs.yml --env-file sqs.env up -d
59+
```
3460

35-
Allow Visual Studio 2024 "multi-launch" so you can easily select the profile you want to run. RabbitMQ, SQS, Azure Service Bus. It can be activated by accessing the Tools menu - Manage preview features- Enable Multi-Project Launch profiles. After this, you should be able to see a Profile dropdown. If you select multiple startup projects, it isn't easy to select the profile (which will be the last used profile for each project). Visual Studio 2024 allows switching between multiple "multi-launch" setups.
61+
## Running the code
3662

37-
## Selecting transport
3863

39-
Each project has 3 launch profiles to select Azure Service Bus, AmazonSQS, or RabbitMQ as the transport and reads environment variables to initialize the transport.
64+
>[!WARNING]
65+
> When using Visual Studio, make sure you have "Enable Multi-Project Launch profiles" setting on. Allow Visual Studio 2024 "multi-launch" so you can easily select the profile you want to run.
66+
>
67+
> It can be activated by accessing the Tools menu -> Manage preview features- Enable Multi-Project Launch profiles.
68+
>
4069
41-
The demo requires running the Particular Service Platform for MassTransit as described above.
70+
After opening the solutions (from Visual Studio or Rider), choose one of the run profiles that matches the transport configured previously:
71+
- `RabbitMQ`
72+
- `AmazonSQS`
73+
- `Azure Service Bus`

src/Helper/BusRegistrationConfiguratorExt.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static void SetupTransport(this IBusRegistrationConfigurator x, string[]
3636
{
3737
x.UsingRabbitMq((context, cfg) =>
3838
{
39-
cfg.Host("localhost", "/", h =>
39+
cfg.Host("localhost", 56721, "/", h =>
4040
{
4141
h.Username("guest");
4242
h.Password("guest");

src/docker-compose-base.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ services:
2424
service-control:
2525
condition: service_healthy
2626
container_name: masstransit-connector
27-
image: particular/servicecontrol-connector-masstransit:latest
27+
image: particular/servicecontrol-connector-masstransit:0.1.0-alpha.2
2828
command: "--setup-and-run"
2929
environment:
3030
- TRANSPORTTYPE

0 commit comments

Comments
 (0)