|
1 | 1 | # MassTransitShowcaseDemo
|
2 | 2 |
|
3 |
| -A MassTransit version of the [NServiceBus Monitoring Demo](https://github.com/Particular/MonitoringDemo/) |
4 | 3 |
|
5 | 4 | ## Launching the Particular Platform for MassTransit
|
| 5 | +To run the code sample you have 3 options in terms of transports: |
6 | 6 |
|
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 |
8 | 14 | ```cmd
|
9 |
| -cd src |
10 | 15 | docker compose -f docker-compose-base.yml -f compose-rabbitmq.yml --env-file rabbit.env up -d
|
11 | 16 | ```
|
| 17 | +## **Azure ServiceBus** |
12 | 18 |
|
13 |
| -To launch using **Amazon SQS**: |
| 19 | +Configure the access to your Azure Service Bus namespace by editing the variables in `asb.env` |
14 | 20 |
|
15 |
| -First you need to update the variables in `sqs.env` with all the account details and then |
16 | 21 | ```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]" |
| 23 | +``` |
| 24 | + |
| 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]" |
19 | 29 | ```
|
20 | 30 |
|
21 |
| -To launch using **Azure ServiceBus**: |
| 31 | +Run docker command bellow from the `src` folder in a CLI |
22 | 32 |
|
23 |
| -First you need to update the variables in `asb.env` with all the account details and then |
24 | 33 | ```cmd
|
25 |
| -cd src |
26 | 34 | docker compose -f docker-compose-base.yml -f compose-azure.yml --env-file asb.env up -d
|
27 | 35 | ```
|
28 | 36 |
|
29 |
| -## Prerequisites |
| 37 | +## **Amazon SQS** |
| 38 | + |
| 39 | +Configure the access to your SQS namespace by editing the variables in `sqs.env` |
30 | 40 |
|
31 |
| -- Have "Enable Multi-Project Launch profiles" enabled |
| 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: |
| 48 | + |
| 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 | +``` |
| 54 | + |
| 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 | +``` |
32 | 60 |
|
33 |
| -### Enable Multi-Project Launch profiles |
| 61 | +## Running the code |
34 | 62 |
|
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. |
36 | 63 |
|
37 |
| -## Selecting 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 | +> |
38 | 69 |
|
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. |
| 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` |
40 | 74 |
|
41 |
| -The demo requires running the Particular Service Platform for MassTransit as described above. |
| 75 | +Run the solution to start the demo. |
0 commit comments