LavinMQHostingExtension Methods
ClassMethods3 members
Provides extension methods for configuring and adding a LavinMQ container as a resource within a distributed application using Aspire.Hosting. This enables connection, health checks, and specific configurations for LavinMQ instances.
AddLavinMQ(IDistributedApplicationBuilder, string, int, int)Section titled AddLavinMQ(IDistributedApplicationBuilder, string, int, int)extensionIResourceBuilder<LavinMQContainerResource> Adds a LavinMQ container resource to the distributed application builder. Configures the resource with specified parameters and sets up health checks for the resource.
public static class LavinMQHostingExtension{ public static IResourceBuilder<LavinMQContainerResource> AddLavinMQ( this IDistributedApplicationBuilder builder, string name, int amqpPort = 5672, int managementPort = 15672) { // ... }}Parameters
builderIDistributedApplicationBuilderThe distributed application builder to which the LavinMQ resource will be added.namestringThe name of the LavinMQ resource.amqpPortintoptionalThe port number for the AMQP protocol. Default is 5672.managementPortintoptionalThe port number for the management interface. Default is 15672.Returns
IResourceBuilder<LavinMQContainerResource>A resource builder for the LavinMQ container resource.Exceptions
DistributedApplicationExceptionThrown when the resource addition fails or other errors occur during the process.WithDataBindMount(IResourceBuilder<LavinMQContainerResource>, string, bool)Section titled WithDataBindMount(IResourceBuilder<LavinMQContainerResource>, string, bool)extensionIResourceBuilder<LavinMQContainerResource> Configures a bind mount for the LavinMQ container resource to allow data persistence. The method mounts a specified source path on the host to the container's data directory.
public static class LavinMQHostingExtension{ public static IResourceBuilder<LavinMQContainerResource> WithDataBindMount( this IResourceBuilder<LavinMQContainerResource> builder, string source, bool isReadOnly = false) { // ... }}Parameters
builderIResourceBuilder<LavinMQContainerResource>The resource builder for the LavinMQ container to which the data bind mount will be added.sourcestringThe source path on the host machine to bind mount to the container's data directory.isReadOnlybooloptionalIndicates if the bind mount should be configured as read-only. Default is false.Returns
IResourceBuilder<LavinMQContainerResource>An updated resource builder for the LavinMQ container resource with the configured data bind mount.Exceptions
ArgumentNullExceptionThrown when the builder or source parameters are null.WithDataVolume(IResourceBuilder<LavinMQContainerResource>, string, bool)Section titled WithDataVolume(IResourceBuilder<LavinMQContainerResource>, string, bool)extensionIResourceBuilder<LavinMQContainerResource> Configures a data volume for the LavinMQ container resource by specifying its name and read-only status.
public static class LavinMQHostingExtension{ public static IResourceBuilder<LavinMQContainerResource> WithDataVolume( this IResourceBuilder<LavinMQContainerResource> builder, string name, bool isReadOnly = false) { // ... }}Parameters
builderIResourceBuilder<LavinMQContainerResource>The resource builder for the LavinMQ container resource.namestringThe name of the data volume to be attached to the LavinMQ container resource.isReadOnlybooloptionalIndicates whether the data volume should be mounted as read-only. Default is false.Returns
IResourceBuilder<LavinMQContainerResource>The updated resource builder for the LavinMQ container resource.