CommunityToolkit / Aspire

A community project with additional components and extensions for .NET Aspire
MIT License
231 stars 29 forks source link

Particular Service Platform Integration #177

Open brian-guerrero opened 1 month ago

brian-guerrero commented 1 month ago

.NET Aspire issue link

No response

Overview

The Particular Service Platform is a popular service that is used to build distributed systems with NServicebus. Having support for transports such as RabbitMQ and Azure Service Bus in Aspire, it should be easy to plug and play transports and stand up infrastructure in an Aspire host project.

Usage example

@jbogard wrote an interesting article on how he was able to stand up Service Control infrastructure in Aspire. Learning from his approach I think we can possibly simplify set up down to a builder extension API such as:

builder.AddParticularServicePlatform(license)
.WithTransport(transport, options);

Depending on transport relevant configuration options can be selected (i.e. .QuorumConventionalRouting for Rabbit MQ transports, defining Topic Name for Azure service bus, etc.)

The AddParticularServicePlatform extension would be composed calls to other public extensions(so things can be configurable) that set up respective infrastructure:

builder
   .AddServiceControlRavenDatabase(options) // Sets up RavenDB image required by Particular
   .AddServiceControl(options) // Sets up Service Control image
   .AddServiceControlAudit(options) // Sets up Service Control Audit image
   .AddServiceControlMonitoring(options) // Sets up Service Control Monitoring image
   .AddServicePulse(options) // Sets up Service image

Additional context

No response

Help us help you

Yes, I'd like to be assigned to work on this item

aaronpowell commented 1 month ago
builder
   .AddServiceControlRavenDatabase(options) // Sets up RavenDB image required by Particular
   .AddServiceControl(options) // Sets up Service Control image
   .AddServiceControlAudit(options) // Sets up Service Control Audit image
   .AddServiceControlMonitoring(options) // Sets up Service Control Monitoring image
   .AddServicePulse(options) // Sets up Service image

Maybe it's because I'm not familiar with the technology, but I feel like that design isn't really aligned to how Aspire works. Wouldn't it make sense to have the various supporting resources like RavenDB created in Aspire and then provided as references to NServicebus?

brian-guerrero commented 1 month ago

@aaronpowell I think that makes sense. Particular has a preferred image for RavenDB to ensure compatibility with Service Control instances, so as long as there is a RavenDB resource that allows you to specify an image that approach should be fine.

Just for more context: This RavenDB is not directly used directly by NServiceBus. This RavenDB is an infrastructure requirement of ServiceControl. Then ServiceControl instance work as a backend as a backend for Service Pulse. You don't necessarily need an Audit or Monitoring instance but having them will help you track message and saga flows or gather metrics in tools like the provided Service Pulse - web dashboard, or Service Insight - desktop app.

aaronpowell commented 4 weeks ago

hmm ok. It's really not a technology that I'm familiar with so I'll delegate the things that to you from a proposal approach.

If you draft something up we can help refine it to be aligned with the kind of API design that Aspire uses.