Skip to content
Docs Try Aspire

LavinMQHostingExtension Methods

Class Methods 3 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) extension IResourceBuilder<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)
{
// ...
}
}
builder IDistributedApplicationBuilder The distributed application builder to which the LavinMQ resource will be added.
name string The name of the LavinMQ resource.
amqpPort int optional The port number for the AMQP protocol. Default is 5672.
managementPort int optional The port number for the management interface. Default is 15672.
IResourceBuilder<LavinMQContainerResource> A resource builder for the LavinMQ container resource.
DistributedApplicationException Thrown when the resource addition fails or other errors occur during the process.
WithDataBindMount(IResourceBuilder<LavinMQContainerResource>, string, bool) Section titled WithDataBindMount(IResourceBuilder<LavinMQContainerResource>, string, bool) extension IResourceBuilder<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)
{
// ...
}
}
builder IResourceBuilder<LavinMQContainerResource> The resource builder for the LavinMQ container to which the data bind mount will be added.
source string The source path on the host machine to bind mount to the container's data directory.
isReadOnly bool optional Indicates if the bind mount should be configured as read-only. Default is false.
IResourceBuilder<LavinMQContainerResource> An updated resource builder for the LavinMQ container resource with the configured data bind mount.
ArgumentNullException Thrown when the builder or source parameters are null.
WithDataVolume(IResourceBuilder<LavinMQContainerResource>, string, bool) Section titled WithDataVolume(IResourceBuilder<LavinMQContainerResource>, string, bool) extension IResourceBuilder<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)
{
// ...
}
}
builder IResourceBuilder<LavinMQContainerResource> The resource builder for the LavinMQ container resource.
name string The name of the data volume to be attached to the LavinMQ container resource.
isReadOnly bool optional Indicates whether the data volume should be mounted as read-only. Default is false.
IResourceBuilder<LavinMQContainerResource> The updated resource builder for the LavinMQ container resource.