From 69941b8126eec417dcf30b112ecc9656a5b1eab4 Mon Sep 17 00:00:00 2001 From: Rinka Yoshida <69820997+cryoshida@users.noreply.github.com> Date: Fri, 25 Oct 2024 13:09:36 -0700 Subject: [PATCH] [MINOR]: Update asyncapi Kafka consumer to use bootstrap server url (#2913) --- internal/asyncapi/account_details.go | 1 + internal/asyncapi/command_export.go | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/asyncapi/account_details.go b/internal/asyncapi/account_details.go index fd70961a92..fa92cfbfba 100644 --- a/internal/asyncapi/account_details.go +++ b/internal/asyncapi/account_details.go @@ -38,6 +38,7 @@ type accountDetails struct { clusterCreds *config.APIKeyPair consumer *ckgo.Consumer kafkaUrl string + kafkaBootstrapUrl string schemaRegistryUrl string srClient *schemaregistry.Client subjects []string diff --git a/internal/asyncapi/command_export.go b/internal/asyncapi/command_export.go index 6b2e7d0e08..32c0a66b5e 100644 --- a/internal/asyncapi/command_export.go +++ b/internal/asyncapi/command_export.go @@ -227,7 +227,7 @@ func (c *command) getAccountDetails(cmd *cobra.Command, flags *flags) (*accountD // Create Consumer if flags.consumeExamples { - details.consumer, err = createConsumer(details.kafkaUrl, details.clusterCreds, flags.group) + details.consumer, err = createConsumer(details.kafkaBootstrapUrl, details.clusterCreds, flags.group) if err != nil { return nil, err } @@ -440,7 +440,9 @@ func (c *command) getClusterDetails(details *accountDetails, flags *flags) error details.kafkaClusterId = cluster.ID details.schemaRegistryClusterId = clusters[0].GetId() details.clusterCreds = clusterCreds + // kafkaUrl is used in exported file, while kafkaBootstrapUrl is used to create Kafka consumer details.kafkaUrl = kafkaREST.CloudClient.GetUrl() + details.kafkaBootstrapUrl = cluster.Bootstrap details.schemaRegistryUrl = clusters[0].Spec.GetHttpEndpoint() details.topics = topics.Data