Get started with LavinMQ and Aspire
此内容尚不支持你的语言。
⭐ Community Toolkit
LavinMQ is a message broker that implements AMQP 0-9-1 and is wire-compatible with RabbitMQ. The Aspire hosting integration runs LavinMQ as a container and exposes its AMQP connection properties to consuming apps.
Why use LavinMQ with Aspire
Section titled “Why use LavinMQ with Aspire”- Container orchestration. Aspire runs
docker.io/cloudamqp/lavinmqwith AMQP and management endpoints. - Connection-property injection. Referencing the resource provides the host, port, credentials, and AMQP URI to an app.
- Persistent storage options. Store broker data in a named volume or a host bind mount.
- Built-in health checks. The hosting integration checks the broker through a RabbitMQ-compatible connection.
- Multi-language clients. C#, TypeScript, Python, and Go can use established RabbitMQ-compatible AMQP 0-9-1 libraries.
LavinMQ has no dedicated Community Toolkit client package. Use the Aspire RabbitMQ client integration for C# or a RabbitMQ-compatible client for your language.
How the pieces fit together
Section titled “How the pieces fit together”architecture-beta group apphost(server)[AppHost] group consumer(server)[Consuming app] service hosting(server)[Hosting integration] in apphost service lavinmq(server)[LavinMQ broker] in apphost service client(iconoir:server-connection)[AMQP client] in consumer service app(server)[Application] in consumer hosting:R --> L:lavinmq lavinmq:R --> L:client client:R --> L:app
-
Model LavinMQ in the AppHost
Section titled “Model LavinMQ in the AppHost”Install the hosting integration, add the broker resource, and configure ports or persistent storage.
Set up LavinMQ
-
Connect from an app
Section titled “Connect from an app”Reference the broker from an app and use the injected AMQP URI with a RabbitMQ-compatible client.
Connect to LavinMQ