Watch Aspire live streamsDokumentationPrøv Aspire

Get started with ActiveMQ integration

Dette indhold er ikke tilgængeligt i dit sprog endnu.

⭐ Community Toolkit ActiveMQ logo

Use the ActiveMQ integration from the Aspire Community Toolkit to run ActiveMQ Classic or ActiveMQ Artemis as a container resource. Both brokers expose a TCP endpoint that you can reference from application resources.

  • An Aspire AppHost project
  • An ActiveMQ client library compatible with the broker you choose

Install the 📦 CommunityToolkit.Aspire.Hosting.ActiveMQ package in the AppHost:

Terminal
aspire add CommunityToolkit.Aspire.Hosting.ActiveMQ

Choose either ActiveMQ Classic or Artemis in your AppHost. See Set up ActiveMQ in the AppHost for credentials, the web console, schemes, and storage options.

apphost.mts
import { createBuilder } from './.aspire/modules/aspire.mjs';
const builder = await createBuilder();
const username = await builder.addParameter('activemq-user', {
value: 'admin',
publishValueAsDefault: true,
});
const password = await builder.addParameter('activemq-password', {
value: 'admin',
secret: true,
});
const broker = await builder.addActiveMQ('activemq', {
userName: username,
password,
});
await builder.build().run();

The package also provides AddActiveMQArtemis and addActiveMQArtemis for the Artemis image. A connection name such as activemq is used when another resource references the broker.