Skip to content

Commit 7610ee3

Browse files
authored
Merge pull request #63 from Particular/alignwithsamples
Aligned with code under samples and improved the running profiles
2 parents ba57f65 + 0978a16 commit 7610ee3

19 files changed

+170
-108
lines changed

README.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,30 @@
22

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

5-
## Launching the Particular Platform
5+
## Launching the Particular Platform for MassTransit
66

7-
The Particular Service Platform can be pulled down using [the showcase provided `docker-compose.yml`](/src/docker-compose.yml) which uses **RabbitMQ**
7+
To launch using **RabbitMQ**:
8+
```cmd
9+
cd src
10+
docker compose -f docker-compose-base.yml -f compose-rabbitmq.yml --env-file rabbit.env up -d
11+
```
12+
13+
To launch using **Amazon SQS**:
14+
15+
First you need to update the variables in `sqs.env` with all the account details and then
16+
```cmd
17+
cd src
18+
docker compose -f docker-compose-base.yml -f compose-sqs.yml --env-file sqs.env up -d
19+
```
820

21+
To launch using **Azure ServiceBus**:
22+
23+
First you need to update the variables in `asb.env` with all the account details and then
924
```cmd
1025
cd src
11-
docker compose up
26+
docker compose -f docker-compose-base.yml -f compose-azure.yml --env-file asb.env up -d
1227
```
28+
1329
## Prerequisites
1430

1531
- Have "Enable Multi-Project Launch profiles" enabled
@@ -22,4 +38,4 @@ Allow Visual Studio 2024 "multi-launch" so you can easily select the profile you
2238

2339
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.
2440

25-
The demo requires running the Particular Service Platform for MassTransit as well as a RabbitMQ broker. The whole package can be pulled down using Docker compose and the dockerfile at [~/src/docker-compose.yml](/src/docker-compose.yml)
41+
The demo requires running the Particular Service Platform for MassTransit as described above.

src/.run/AmazonSQS.run.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="AmazonSQS" type="CompoundRunConfigurationType">
3+
<toRun name="Billing: AmazonSQS" type="LaunchSettings" />
4+
<toRun name="ClientUI: AmazonSQS" type="LaunchSettings" />
5+
<toRun name="Sales: AmazonSQS" type="LaunchSettings" />
6+
<toRun name="Shipping: AmazonSQS" type="LaunchSettings" />
7+
<method v="2" />
8+
</configuration>
9+
</component>

src/.run/Azure.run.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="Azure" type="CompoundRunConfigurationType">
3+
<toRun name="Billing: Azure Service Bus" type="LaunchSettings" />
4+
<toRun name="ClientUI: Azure Service Bus" type="LaunchSettings" />
5+
<toRun name="Sales: Azure Service Bus" type="LaunchSettings" />
6+
<toRun name="Shipping: Azure Service Bus" type="LaunchSettings" />
7+
<method v="2" />
8+
</configuration>
9+
</component>

src/.run/RabbitMQ.run.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="RabbitMQ" type="CompoundRunConfigurationType">
3+
<toRun name="Billing: RabbitMQ" type="LaunchSettings" />
4+
<toRun name="ClientUI: RabbitMQ" type="LaunchSettings" />
5+
<toRun name="Sales: RabbitMQ" type="LaunchSettings" />
6+
<toRun name="Shipping: RabbitMQ" type="LaunchSettings" />
7+
<method v="2" />
8+
</configuration>
9+
</component>

src/Billing/ConsoleBackgroundService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken)
1313
Console.Clear();
1414
await Console.Out.WriteLineAsync("""
1515
Billing Endpoint:
16-
16+
1717
- Press I to increase the simulated failure rate
1818
- Press D to decrease the simulated failure rate
1919
- Press R to reset simulation

src/Billing/Program.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
namespace Billing;
2-
32
using Microsoft.Extensions.Hosting;
43
using MassTransit;
54
using Microsoft.Extensions.DependencyInjection;
@@ -20,7 +19,6 @@ public static IHostBuilder CreateHostBuilder(string[] args)
2019
services.AddMassTransit(x =>
2120
{
2221
x.AddConsumers(Assembly.GetExecutingAssembly());
23-
2422
x.SetupTransport(args);
2523
});
2624

src/Billing/Properties/launchSettings.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"profiles": {
3-
"Azure Service Bus": {
3+
"RabbitMQ": {
44
"commandName": "Project",
5-
"commandLineArgs": "--azureservicebus",
5+
"commandLineArgs": "--rabbitmq",
66
"launchBrowser": false,
77
"environmentVariables": {
88
"ASPNETCORE_ENVIRONMENT": "Development"
99
}
1010
},
11-
"RabbitMQ": {
11+
"Azure Service Bus": {
1212
"commandName": "Project",
13-
"commandLineArgs": "--rabbitmq",
13+
"commandLineArgs": "--azureservicebus",
1414
"launchBrowser": false,
1515
"environmentVariables": {
1616
"ASPNETCORE_ENVIRONMENT": "Development"

src/ClientUI/Properties/launchSettings.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"profiles": {
3-
"Azure Service Bus": {
3+
"RabbitMQ": {
44
"commandName": "Project",
5-
"commandLineArgs": "--azureservicebus",
5+
"commandLineArgs": "--rabbitmq",
66
"launchBrowser": false,
77
"environmentVariables": {
88
"ASPNETCORE_ENVIRONMENT": "Development"
99
}
1010
},
11-
"RabbitMQ": {
11+
"Azure Service Bus": {
1212
"commandName": "Project",
13-
"commandLineArgs": "--rabbitmq",
13+
"commandLineArgs": "--azureservicebus",
1414
"launchBrowser": false,
1515
"environmentVariables": {
1616
"ASPNETCORE_ENVIRONMENT": "Development"

src/Helper/IBusRegistrationConfiguratorExt.cs renamed to src/Helper/BusRegistrationConfiguratorExt.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System.Reflection.Metadata;
2-
using MassTransit;
1+
using MassTransit;
32

43
public static class BusRegistrationConfiguratorExt
54
{

src/Sales/Properties/launchSettings.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"profiles": {
3-
"Azure Service Bus": {
3+
"RabbitMQ": {
44
"commandName": "Project",
5-
"commandLineArgs": "--azureservicebus",
5+
"commandLineArgs": "--rabbitmq",
66
"launchBrowser": false,
77
"environmentVariables": {
88
"ASPNETCORE_ENVIRONMENT": "Development"
99
}
1010
},
11-
"RabbitMQ": {
11+
"Azure Service Bus": {
1212
"commandName": "Project",
13-
"commandLineArgs": "--rabbitmq",
13+
"commandLineArgs": "--azureservicebus",
1414
"launchBrowser": false,
1515
"environmentVariables": {
1616
"ASPNETCORE_ENVIRONMENT": "Development"

0 commit comments

Comments
 (0)