Get started with Redpanda integration
Bu içerik henüz dilinizde mevcut değil.
Redpanda is a Kafka API-compatible streaming platform. The Community Toolkit integration runs a Redpanda broker in a container and exposes its Kafka API, Schema Registry, and Admin API endpoints.
Prerequisites
Section titled “Prerequisites”- An Aspire AppHost project
- A Kafka client integration for any application that connects to the broker
Add Redpanda to your AppHost
Section titled “Add Redpanda to your AppHost”Install the 📦 CommunityToolkit.Aspire.Hosting.RedPanda package in the AppHost:
aspire add CommunityToolkit.Aspire.Hosting.RedPandaAdd a broker and reference it from the client resource. See Set up Redpanda in the AppHost for persistence, resource sizing, and optional web consoles.
import { createBuilder } from './.aspire/modules/aspire.mjs';
const builder = await createBuilder();const redpanda = await builder.addRedPanda('redpanda');const api = await builder.addProject('api', '../Api/Api.csproj');await api.withReference(redpanda);await api.waitFor(redpanda);
await builder.build().run();var builder = DistributedApplication.CreateBuilder(args);var redpanda = builder.AddRedPanda("redpanda");
builder.AddProject<Projects.Api>("api") .WithReference(redpanda) .WaitFor(redpanda);
// After adding all resources, run the app...builder.Build().Run();The Kafka bootstrap address exposed to referencing resources uses the host:port format. Redpanda can be used with the Aspire Kafka client integration. For client setup, see Connect to Apache Kafka.