Skip to content

Particular/MassTransitShowcaseDemo

Repository files navigation

MassTransit Error Management - Showcase

This showcase consists of 4 processes hosting MassTransit message producers and consumers that implement a simplified order processing logic from an e-commerce system.

System Overview

Launching the Showcase in Docker

The showcase requires a connection to a broker (by default RabbitMQ), ServiceControl container, ServicePulse container and the MassTransit Connector for ServiceControl container.
To help getting started we have created a few docker compose files that orchestrate all this setup for you.

Run the docker command below from the src folder in a terminal.

docker compose -p particular-platform-showcase -f docker-compose-base.yml -f compose-rabbitmq.yml --env-file rabbit.env up -d

(Alternative) Run in Docker against Azure Service Bus

The showcase can also be run using Azure Service Bus rather than RabbitMQ. First configure the access to your Azure Service Bus namespace by editing the variables in `src/asb.env`.
CONNECTIONSTRING="Endpoint=sb://[NAMESPACE].servicebus.windows.net/;SharedAccessKeyName=[KEYNAME];SharedAccessKey=[KEY]"

Run docker command below from the src folder in a terminal.

docker compose -p particular-platform-showcase -f docker-compose-base.yml -f compose-azure.yml --env-file asb.env up -d

(Alternative) Run from an IDE

> [!WARNING] > When using Visual Studio, ensure you have the "Enable Multi-Project Launch profiles" setting on. Allow Visual Studio 2022 "multi-launch" so you can easily select the profile you want to run. > > It can be activated by accessing the Tools menu -> Manage preview features- Enable Multi-Project Launch profiles.

To start the required infrastructure for the showcase, run one of the docker command below from the src folder in a terminal.

RabbitMQ

docker compose -p particular-platform-showcase -f docker-compose-base.yml -f compose-rabbitmq.yml --env-file rabbit.env --profile infrastructure --profile frontend up -d

Azure Service Bus

See ASB setup above for setting the connection string to your Azure Service Bus namespace

docker compose -p particular-platform-showcase -f docker-compose-base.yml -f compose-azure.yml --env-file asb.env --profile infrastructure --profile frontend up -d

After opening the solution (from Visual Studio or Rider), choose one of the run profiles that matches the transport configured previously:

  • RabbitMQ
  • Azure Service Bus

Run the solution to start the demo.

Opening the showcase UI

Navigate to http://localhost:61335/ to see the UI. Click Run Scenario to start the showcase scenario and generate some simulated message handling failures.

Handling failures with the Particular Platform

Inspecting failures

Navigate to http://localhost:9090 in a new tab, or click the View in ServicePulse button, to see the details on failures ingested by the platform.

Service Pulse Dashboard

Scheduling message reprocessing

Click on the "Failed Messages" button at the top of the page to see all failed messages ingested by the platform, grouped by the exception type and stack trace.

Service Pulse Failed Messages

Drill into an existing group to see the list of individual processing failures. Clicking on any of the rows in the list shows detailed information of a given failed message in the headers and message body tabs.

A failed message can be scheduled for reprocessing by clicking the Retry message button.

Note

It may take several seconds after retrying a message for it to appear again in the consumer's input queue

Service Pulse Failed Message View

Editing messages before reprocessing

Go to the details page for one of the failed messages and click the Edit & retry button. The pop-up window shows the headers collection and the message body in two separate tabs.

Navigate to the Message Body tab and change some of the contents of the message, ensuring it's still valid JSON matching the message type, and click "Retry" to schedule the message for reprocessing.

Warning

Changing or deleting header values may change or cause issues with the subsequent re-processing. It is recommended that these values are not changed if you are unsure of their purpose.

Edit Message View

Viewing retries

Return to the showcase UI to see that the retries have now been successfully handled.

Troubleshooting

Having issues?

  • Check logs in docker. Ensure that there are no port clashes with existing containers or services on your machine.
  • Ask any questions on our forum

About

A MassTransit version of the ShowCase

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published