This article provides instructions on setting up the local development environment for the Message Bus Proof of Concept (MB) solution. The instructions mentioned in this article assume that you have access to the resources mentioned below.
Make sure to enable the following features:
- .NET desktop development
- Azure development
- Node.js development
- .NET Core cross-platform development
Download and install the .NET Core 3.1.201 SDK
Download and install Node.js and make sure node
and npm
commands are added to your PATH
.
The MB solution uses RabbitMQ as its message broker to communicate between clients and services during local development.
RabbitMQ can be installed in two ways:
- In a Docker container
- On your Windows OS as a Windows Service
Assuming you have installed the latest version of docker, you can run a local RabbitMQ instance inside a Docker container.
- Switch to Linux Containers
- Execute
docker run -d --hostname rabbitmq --name rabbitmq -p 15672:15672 -p 5672:5672 rabbitmq:3-management
. This creates a local RabbitMQ instance which can be reached atrabbitmq://localhost
and uses the default port5672
. It has the Management Plugin installed by default. *) - Connect to the Management Plugin using http://localhost:15672 to confirm that the instance is up and running (username: guest, password: guest).
- Change the
ConnectionString:MessageBus
appSetting torabbitmq://localhost
. *) port 15672 can be changed if required.
Troubleshooting:
- Execute the commands as Administrator
- Restart the Docker deamon
- Download and install RabbitMQ Server
- When prompted, download and install Erlang
- Search and run RabbitMQ Command Prompt (sbin dir) from the Windows start menu
- Run the following command to enable the RabbitMQ Management Plugin:
rabbitmq-plugins enable rabbitmq_management
- Check if RabbitMQ is running by navigating to http://localhost:15672/ in a browser window (use guest when prompted for a Username and Password)
SwitchStartupProject (https://bitbucket.org/thirteen/switchstartupproject/src) Using the PH.sln.startup.json file to allow custom startup project groups (i.e. Payment Client & Microservice projects).
Open Command Line (https://marketplace.visualstudio.com/items?itemName=MadsKristensen.OpenCommandLine) Allows executing .bat files from Solution Explorer
Add New File (https://marketplace.visualstudio.com/items?itemName=MadsKristensen.AddNewFile) Makes it easy to add new files to solution using Shift+F2
SonarLint (https://marketplace.visualstudio.com/items?itemName=SonarSource.SonarLintforVisualStudio2019) Provides helpful messages/warning regarding code style, quality etc.
CodeMaid (https://marketplace.visualstudio.com/items?itemName=SteveCadwallader.CodeMaid) Cleans and structures code on file save.
- Open a VS2019 command prompt window
- Open the solution
- Build the solution