Skip to content

Releases: confluentinc/confluent-kafka-go

v0.11.6

25 Oct 07:46
Compare
Choose a tag to compare

Admin API

This release adds support for the Topic Admin API (KIP-4):

  • Create and delete topics
  • Increase topic partition count
  • Read and modify broker and topic configuration
  • Requires librdkafka >= v0.11.6
results, err := a.CreateTopics(
	ctx,
	// Multiple topics can be created simultaneously
	// by providing additional TopicSpecification structs here.
	[]kafka.TopicSpecification{{
		Topic:             "mynewtopic",
		NumPartitions:     20,
		ReplicationFactor: 3}})

More examples.

Fixes and enhancements

  • Make sure plugins are set before other configuration options (#225, @dtheodor)
  • Fix metadata memory leak
  • Clone config before mutating it in NewProducer and NewConsumer (@vlad-alexandru-ionescu)
  • Enable Error events to be emitted from librdkafka errors, e.g., ErrAllBrokersDown, et.al (#200)

v0.11.4

28 Mar 17:08
Compare
Choose a tag to compare

Announcements

  • This release drops support for Golang < 1.7

  • Requires librdkafka v0.11.4 or later

Message header support

Support for Kafka message headers has been added (requires broker version >= v0.11.0).

When producing messages, pass a []kafka.Header list:

        err = p.Produce(&kafka.Message{
                TopicPartition: kafka.TopicPartition{Topic: &topic, Partition: kafka.PartitionAny},
                Value:          []byte(value),
                Headers:        []kafka.Header{{"myTestHeader", []byte("header values are binary")}},
        }, deliveryChan)

Message headers are available to the consumer as Message.Headers:

	msg, err := c.ReadMessage(-1)
	if err != nil {
		fmt.Printf("%% Consumer error: %v\n", err)
		continue
	}
	fmt.Printf("%% Message on %s:\n%s\n", msg.TopicPartition, string(msg.Value))
	if msg.Headers != nil {
		fmt.Printf("%% Headers: %v\n", msg.Headers)
	}

Enhancements

  • Message Headers support
  • Close event channel when consumer is closed (#123 by @czchen)
  • Added ReadMessage() convenience method to Consumer
  • producer: Make events channel size configurable (@agis)
  • Added Consumer.StoreOffsets() (#72)
  • Added ConfigMap.Get() (#26)
  • Added Pause() and Resume() APIs
  • Added Consumer.Committed() API
  • Added OffsetsForTimes() API to Consumer and Producer

Fixes

  • Static builds should now work on both OSX and Linux (#137, #99)
  • Update error constants from librdkafka
  • Enable produce.offset.report by default (unless overriden)
  • move test helpers that need testing pkg to _test.go file (@gwilym)
  • Build and run-time checking of librdkafka version (#88)
  • Remove gotos (@jadekler)
  • Fix Producer Value&Key slice referencing to avoid cgo pointer checking failures (#24)
  • Fix Go 1.10 build errors (drop pkg-config --static ..)

v0.11.0

25 Jul 21:18
Compare
Choose a tag to compare

This is a minimal librdkafka version-synchronized release of the Go client.

Changes:

  • Requires librdkafka v0.11.0 or later
  • Added stats events (#57)
  • Updated librdkafka error codes
  • Fix signal channel buffering in example (#66)