0

I am wrapping the C library librdkafka in Crystal using the following code:

def produce(topic : String, key : Bytes,  payload : Bytes)
  err = LibKafkaC.producev(
    @handle,
    LibKafkaC::VTYPE::TOPIC, topic,
    LibKafkaC::VTYPE::VALUE, payload, payload.size,
    LibKafkaC::VTYPE::KEY, key, key.size,
    LibKafkaC::VTYPE::END
  )
  raise KafkaProducerException.new(err) if err != LibKafkaC::OK
end

This calls this function in the C library.

However when running this code on an Enterprise Linux server I get this error: Broker: Message size too large which is being thrown here. This error occurs regardless of the size of the message I try to produce and even if the Kafka instance is turned off.

This works when running on my Mac.

Initially I thought this was because the EL server had rdkafka 0.11.4 installed and on my mac I had 2.2.0. However, I have upgraded rdkafka on the EL server and still facing the same error.

I have confirmed that payload.size is 73, I have tried to increase the max message size setting on the Kafka broker.

StuartFrost
  • 299
  • 3
  • 9

0 Answers0