Skip to content
Discussion options

You must be logged in to vote

Thanks - it worked flawlessly. FWIW, here is my complete code snippet in AppHost:

builder.Eventing.Subscribe<ResourceReadyEvent>(kafka.Resource, async (@event, ct) =>
{
    var cs = await kafka.Resource.ConnectionStringExpression.GetValueAsync(ct);

    var config = new AdminClientConfig
    {
        BootstrapServers = cs
    };

    using var adminClient = new AdminClientBuilder(config).Build();
    try
    {
        await adminClient.CreateTopicsAsync(new TopicSpecification[]
        {
                new TopicSpecification { Name = "my-topic-1", NumPartitions = 1, ReplicationFactor = 1 },
                new TopicSpecification { Name = "my-topic-2", NumPartitions = 1, ReplicationFactor =

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@sunerievers
Comment options

Answer selected by davidfowl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants