2

I get error The broker is not available. when I attempt to publish a message to a Redpanda broker. I am using the Sarama Go Kafka client. Here's how I create the producer and publish a message:

kafkaConfig := sarama.NewConfig()
kafkaConfig.Producer.Return.Successes = true
producer, err := sarama.NewSyncProducer(brokerList, kafkaConfig)

if err != nil {
    log.Fatalf("NewSyncProducer failed: %s", err)
    return nil, err
}

message := sarama.ProducerMessage{Topic: "my-topic", Value: sarama.ByteEncoder([]byte("foo"))}

partition, offset, err := producer.SendMessage(&message)

if err != nil {
    log.Errorln(err)
}

err contains kafka server: Broker not available. Not a client facing error, we should never receive this!!!

In the systemctl log I see this when I publish a message:

WARN  2022-11-21 17:53:23,148 [shard 3] kafka - [127.0.0.1:46790] rejecting produce request: no disk space; bytes free less than configurable threshold
ERROR 2022-11-21 17:53:25,941 [shard 0] cluster - (rate limiting dropped 359 similar messages) storage space alert: free space at 18.208% on /var/lib/redpanda/data: 23.517GiB total, 4.282GiB free, min. free 0.000bytes. Please adjust retention policies as needed to allow writing again

What setting controls this threshold?

user2233706
  • 6,148
  • 5
  • 44
  • 86

1 Answers1

1

@user2233706 - you need to create the topic first. Otherwise ensure that etc/redpanda/redpanda.yaml has autocreate topics set to true.