# ActiveMQBuilderExtensions Methods

- Package: [CommunityToolkit.Aspire.Hosting.ActiveMQ](/reference/api/csharp/communitytoolkit.aspire.hosting.activemq.md)
- Type: [ActiveMQBuilderExtensions](/reference/api/csharp/communitytoolkit.aspire.hosting.activemq/activemqbuilderextensions.md)
- Kind: `Methods`
- Members: `6`

Provides extension methods for adding ActiveMQ resources to an `Hosting.IDistributedApplicationBuilder`.

## AddActiveMQ(IDistributedApplicationBuilder, string, IResourceBuilder<ParameterResource>, IResourceBuilder<ParameterResource>, int?, string, int?)

- Name: `AddActiveMQ(IDistributedApplicationBuilder, string, IResourceBuilder<ParameterResource>, IResourceBuilder<ParameterResource>, int?, string, int?)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<ActiveMQServerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9dc6fc02412d7398c5722840513d99965a6e98f/src/CommunityToolkit.Aspire.Hosting.ActiveMQ/ActiveMQBuilderExtensions.cs#L42-L51)

Adds a ActiveMQ container to the application model.

```csharp
public static class ActiveMQBuilderExtensions
{
    public static IResourceBuilder<ActiveMQServerResource> AddActiveMQ(
        this IDistributedApplicationBuilder builder,
        string name,
        IResourceBuilder<ParameterResource>? userName = null,
        IResourceBuilder<ParameterResource>? password = null,
        int? port = null,
        string scheme = "tcp",
        int? webPort = null)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IDistributedApplicationBuilder`)
  The `Hosting.IDistributedApplicationBuilder`.
- `name` (`string`)
  The name of the resource. This name will be used as the connection string name when referenced in a dependency.
- `userName` (`IResourceBuilder<ParameterResource>`) `optional`
  The parameter used to provide the username for the ActiveMQ resource. If `null` a default value will be used.
- `password` (`IResourceBuilder<ParameterResource>`) `optional`
  The parameter used to provide the password for the ActiveMQ resource. If `null` a random password will be generated.
- `port` (`int?`) `optional`
  The host port that the underlying container is bound to when running locally.
- `scheme` (`string`) `optional`
  The scheme of the endpoint, e.g. tcp or activemq (for masstransit). Defaults to tcp.
- `webPort` (`int?`) `optional`
  The host port that the underlying webconsole is bound to when running locally.

## Returns

`IResourceBuilder<ActiveMQServerResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1`.

## Remarks

The default image and tag are "apache/activemq-classic" and "6.1.7".

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

## AddActiveMQArtemis(IDistributedApplicationBuilder, string, IResourceBuilder<ParameterResource>, IResourceBuilder<ParameterResource>, int?, string, int?)

- Name: `AddActiveMQArtemis(IDistributedApplicationBuilder, string, IResourceBuilder<ParameterResource>, IResourceBuilder<ParameterResource>, int?, string, int?)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<ActiveMQArtemisServerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9dc6fc02412d7398c5722840513d99965a6e98f/src/CommunityToolkit.Aspire.Hosting.ActiveMQ/ActiveMQBuilderExtensions.cs#L77-L86)

Adds a ActiveMQ Artemis container to the application model.

```csharp
public static class ActiveMQBuilderExtensions
{
    public static IResourceBuilder<ActiveMQArtemisServerResource> AddActiveMQArtemis(
        this IDistributedApplicationBuilder builder,
        string name,
        IResourceBuilder<ParameterResource>? userName = null,
        IResourceBuilder<ParameterResource>? password = null,
        int? port = null,
        string scheme = "tcp",
        int? webPort = null)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IDistributedApplicationBuilder`)
  The `Hosting.IDistributedApplicationBuilder`.
- `name` (`string`)
  The name of the resource. This name will be used as the connection string name when referenced in a dependency.
- `userName` (`IResourceBuilder<ParameterResource>`) `optional`
  The parameter used to provide the username for the ActiveMQ resource. If `null` a default value will be used.
- `password` (`IResourceBuilder<ParameterResource>`) `optional`
  The parameter used to provide the password for the ActiveMQ resource. If `null` a random password will be generated.
- `port` (`int?`) `optional`
  The host port that the underlying container is bound to when running locally.
- `scheme` (`string`) `optional`
  The scheme of the endpoint, e.g. tcp or activemq (for masstransit). Defaults to tcp.
- `webPort` (`int?`) `optional`
  The host port that the underlying webconsole is bound to when running locally.

## Returns

`IResourceBuilder<ActiveMQArtemisServerResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1`.

## Remarks

The default image and tag are "apache/activemq-artemis" and "2.42.0".

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

## WithConfBindMount(IResourceBuilder<T>, string, bool)

- Name: `WithConfBindMount(IResourceBuilder<T>, string, bool)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<T>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9dc6fc02412d7398c5722840513d99965a6e98f/src/CommunityToolkit.Aspire.Hosting.ActiveMQ/ActiveMQBuilderExtensions.cs#L157)

Adds a bind mount for the conf folder to a ActiveMQ container resource.

```csharp
public static class ActiveMQBuilderExtensions
{
    public static IResourceBuilder<T> WithConfBindMount<T>(
        this IResourceBuilder<T> builder,
        string source,
        bool isReadOnly = false)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<T>`)
  The resource builder.
- `source` (`string`)
  The source directory on the host to mount into the container.
- `isReadOnly` (`bool`) `optional`
  A flag that indicates if this is a read-only mount.

## Returns

`IResourceBuilder<T>` -- The `ApplicationModel.IResourceBuilder`1`.

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

## WithConfVolume(IResourceBuilder<T>, string?, bool)

- Name: `WithConfVolume(IResourceBuilder<T>, string?, bool)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<T>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9dc6fc02412d7398c5722840513d99965a6e98f/src/CommunityToolkit.Aspire.Hosting.ActiveMQ/ActiveMQBuilderExtensions.cs#L130-L133)

Adds a named volume for the config folder to a ActiveMQ container resource.

```csharp
public static class ActiveMQBuilderExtensions
{
    public static IResourceBuilder<T> WithConfVolume<T>(
        this IResourceBuilder<T> builder,
        string? name = null,
        bool isReadOnly = false)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<T>`)
  The resource builder.
- `name` (`string?`) `optional`
  The name of the volume. Defaults to an auto-generated name based on the application and resource names.
- `isReadOnly` (`bool`) `optional`
  A flag that indicates if this is a read-only volume.

## Returns

`IResourceBuilder<T>` -- The `ApplicationModel.IResourceBuilder`1`.

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

## WithDataBindMount(IResourceBuilder<T>, string, bool)

- Name: `WithDataBindMount(IResourceBuilder<T>, string, bool)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<T>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9dc6fc02412d7398c5722840513d99965a6e98f/src/CommunityToolkit.Aspire.Hosting.ActiveMQ/ActiveMQBuilderExtensions.cs#L145)

Adds a bind mount for the data folder to a ActiveMQ container resource.

```csharp
public static class ActiveMQBuilderExtensions
{
    public static IResourceBuilder<T> WithDataBindMount<T>(
        this IResourceBuilder<T> builder,
        string source,
        bool isReadOnly = false)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<T>`)
  The resource builder.
- `source` (`string`)
  The source directory on the host to mount into the container.
- `isReadOnly` (`bool`) `optional`
  A flag that indicates if this is a read-only mount.

## Returns

`IResourceBuilder<T>` -- The `ApplicationModel.IResourceBuilder`1`.

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

## WithDataVolume(IResourceBuilder<T>, string?, bool)

- Name: `WithDataVolume(IResourceBuilder<T>, string?, bool)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<T>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9dc6fc02412d7398c5722840513d99965a6e98f/src/CommunityToolkit.Aspire.Hosting.ActiveMQ/ActiveMQBuilderExtensions.cs#L115-L118)

Adds a named volume for the data folder to a ActiveMQ container resource.

```csharp
public static class ActiveMQBuilderExtensions
{
    public static IResourceBuilder<T> WithDataVolume<T>(
        this IResourceBuilder<T> builder,
        string? name = null,
        bool isReadOnly = false)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<T>`)
  The resource builder.
- `name` (`string?`) `optional`
  The name of the volume. Defaults to an auto-generated name based on the application and resource names.
- `isReadOnly` (`bool`) `optional`
  A flag that indicates if this is a read-only volume.

## Returns

`IResourceBuilder<T>` -- The `ApplicationModel.IResourceBuilder`1`.

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.
