Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump to v1.9.1 #1

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
7182357
v1.8.0 changelogs
edenhill Sep 21, 2021
194896a
Added convenience method StoreMessage that calls StoreOffsets (@finnc…
finncolman Oct 28, 2021
f27b67d
librdkafka static bundle v1.8.2
edenhill Dec 8, 2021
bf3f642
Documentation and error code update for librdkafka v1.8.2
edenhill Dec 8, 2021
0475aec
correct handle's eventPoll RD_KAFKA_EVENT_DR term
zjj Jul 15, 2021
4f3e610
v1.8.2 changelog
edenhill Dec 13, 2021
1d5067b
Reduce number of Travis jobs
edenhill Dec 13, 2021
25808dd
Add some links out to Confluent Developer
Mar 3, 2022
f9fce7a
Create a MockCluster within Go for testing (@SourceFellows, @kkoehler…
Apr 8, 2022
b97c440
Changelog for 1.9.0 (#759)
edenhill Apr 11, 2022
5ef2925
551: migrate to go modules (#760)
eran-levy Apr 19, 2022
8a2fdf0
librdkafka import: --devel would silently purge uncommitted changes
edenhill Apr 26, 2022
b499044
librdkafka import: -framework .. must also be added to build_darwin.go
edenhill Apr 26, 2022
47eb9cf
kafka.go: revert partial f9fce7ae to reinstate package docs
edenhill Apr 26, 2022
e01dd29
Fix Rebalance events behavior for static membership and fix for consu…
jliunyu May 2, 2022
f35b29a
Add service.yml for adding new project to semaphore CI (#789)
jliunyu Jun 14, 2022
f5a8fd9
chore: update repo semaphore project
ConfluentJenkins Jun 14, 2022
5dce6d0
chore: update repo semaphore config
ConfluentJenkins Jun 14, 2022
a3f1fcd
librdkafka static bundle v1.9.0
jliunyu Jun 16, 2022
f195ac6
Documentation and error code update for librdkafka v1.9.0
jliunyu Jun 16, 2022
e50cdaf
chore: update repo semaphore project
ConfluentJenkins Jun 18, 2022
c1ad021
Merge pull request #798 from confluentinc/import_v1.9.0
jliunyu Jun 20, 2022
e34bc9a
Update the consumer close function with the latest rd_kafka_consumer_…
emasab Jun 21, 2022
e1fd1c9
KIP-140: ACL operations (#796) (#799)
emasab Jun 21, 2022
9c586e3
fixes #723 (#787)
emasab Jun 21, 2022
b89b9e4
Improvements to Go client examples (#801)
emasab Jun 21, 2022
d38dbd4
min version check updated to 1.9.0 (#802)
emasab Jun 21, 2022
c6c4e03
version 1.9.0 in CHANGELOG, go.mod, README (#803)
emasab Jun 21, 2022
e7384e7
kafka/consumer: return RevokePartition/AssignPartition events from Po…
igungor Sep 17, 2021
440d0d5
Merge remote-tracking branch 'origin/master'
denizsurmeli Mar 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
\#*
*.prof
tmp-build
.DS_Store
.DS_Store
.idea
23 changes: 23 additions & 0 deletions .semaphore/project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: v1alpha
kind: Project
metadata:
name: confluent-kafka-go
description: ""
spec:
visibility: private
repository:
url: [email protected]:confluentinc/confluent-kafka-go.git
run_on:
- branches
- tags
- pull_requests
pipeline_file: .semaphore/semaphore.yml
integration_type: github_app
status:
pipeline_files:
- path: .semaphore/semaphore.yml
level: pipeline
whitelist:
branches:
- master
- "/^v\\d+\\.\\d+\\.x$/"
81 changes: 81 additions & 0 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
version: v1.0
name: build-test-release
agent:
machine:
type: e1-standard-4
os_image: ubuntu1804

auto_cancel:
running:
when: "branch != 'master'"

execution_time_limit:
hours: 1

global_job_config:
secrets:
- name: vault_sem2_approle
prologue:
commands:
- chmod 400 ~/.ssh/id_rsa
- sem-version go 1.18
- export "GOPATH=$(go env GOPATH)"
- export "SEMAPHORE_GIT_DIR=${GOPATH}/src/github.com/confluentinc/${SEMAPHORE_PROJECT_NAME}"
- export "PATH=${GOPATH}/bin:${PATH}"
- mkdir -vp "${SEMAPHORE_GIT_DIR}" "${GOPATH}/bin"
- git config --global url."[email protected]:".insteadOf "https://github.com/"
- sem-service start postgres 13
# This username/password is just to create test db to run tests. DB will be destroyed when build finishes.
- psql -U postgres -h localhost -c "CREATE USER runner WITH PASSWORD 'semaphoredb';"
- psql -U postgres -h localhost -c "ALTER USER runner WITH SUPERUSER;"
- export ADMIN_DB_URL=postgres://runner:semaphoredb@localhost:5432
# Let the app set the default but don't let cc-go.mk sets the default
- export DB_URL=""
- sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
- wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
- sudo apt-get update
- sudo apt-get -y install postgresql-client-13
- checkout
- make install-vault
- . mk-include/bin/vault-setup
- . vault-sem-get-secret gitconfig
- . vault-sem-get-secret ssh_id_rsa
- . vault-sem-get-secret ssh_config
- . vault-sem-get-secret netrc
- . vault-sem-get-secret artifactory-docker-helm
- . vault-sem-get-secret maven-settings
- . vault-sem-get-secret cpd_gcloud
- . vault-sem-get-secret aws_credentials
- . vault-sem-get-secret testbreak-reporting
- . vault-sem-get-secret v1/ci/kv/service-foundations/cc-mk-include
- exec &> >(tee -a build.log)
- make init-ci
epilogue:
always:
commands:
- make epilogue-ci

blocks:
- name: "Build, Test, Release"
run:
# don't run the build or unit tests on non-functional changes...
when: "change_in('/', {exclude: ['/.deployed-versions/', '.github/']})"
task:
# You can customize your CI job here
# env_vars:
# # custom env_vars
# prologue:
# commands:
# # custom vault secrets
# # custom prologue commands
jobs:
- name: "Build, Test, Release"
commands:
- make build
- make test
- make release-ci
epilogue:
always:
commands:
- make epilogue-ci
- make testbreak-after
25 changes: 6 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,14 @@ jobs:
os: osx
env:
- EXPECT_LINK_INFO="static"
- name: "Go 1.14 OSX bundled librdkafka"
go: "1.14"
os: osx
env:
- EXPECT_LINK_INFO="static"
- name: "Go 1.16 Linux bundled librdkafka"
go: "1.16"
os: linux
env:
- EXPECT_LINK_INFO="static"
- name: "Go 1.14 Linux bundled librdkafka"
go: "1.14"
os: linux
env:
- EXPECT_LINK_INFO="static"
- name: "Go 1.14 OSX dynamic librdkafka"
go: "1.14"
- name: "Go 1.16 OSX dynamic librdkafka"
if: tag is present
go: "1.16"
os: osx
env:
- EXPECT_LINK_INFO="dynamic"
Expand All @@ -37,8 +28,9 @@ jobs:
- LD_LIBRARY_PATH="$HOME/gopath/src/github.com/confluentinc/confluent-kafka-go/tmp-build/lib"
- DYLD_LIBRARY_PATH="$HOME/gopath/src/github.com/confluentinc/confluent-kafka-go/tmp-build/lib"
- LIBRDKAFKA_VERSION=master
- name: "Go 1.14 Linux dynamic librdkafka"
go: "1.14"
- name: "Go 1.16 Linux dynamic librdkafka"
if: tag is present
go: "1.16"
os: linux
env:
- EXPECT_LINK_INFO="dynamic"
Expand All @@ -52,11 +44,6 @@ jobs:
os: windows
env:
- EXPECT_LINK_INFO="static"
- name: "Go 1.14 Windows bundled librdkafka"
go: "1.14"
os: windows
env:
- EXPECT_LINK_INFO="static"

before_install:
- if [[ $TRAVIS_OS_NAME == linux ]]; then wget -qO - https://packages.confluent.io/deb/5.4/archive.key | sudo apt-key add - ; fi
Expand Down
46 changes: 43 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,47 @@
# Confluent's Golang client for Apache Kafka

## v1.7.0
## v1.9.0

confluent-kafka-go is based on librdkafka v1.7.0, see the
[librdkafka release notes](https://github.com/edenhill/librdkafka/releases/tag/v1.7.0)
This is a feature release:

* OAUTHBEARER OIDC support
* KIP-140 Admin API ACL support
* Added MockCluster for functional testing of applications without the need
for a real Kafka cluster (by @SourceFellows and @kkoehler, #729).
See [examples/mock_cluster](examples/mock_cluster).


### Fixes

* Fix Rebalance events behavior for static membership (@jliunyu, #757,
#798).
* Fix consumer close taking 10 seconds when there's no rebalance
needed (@jliunyu, #757).

confluent-kafka-go is based on librdkafka v1.9.0, see the
[librdkafka release notes](https://github.com/edenhill/librdkafka/releases/tag/v1.9.0)
for a complete list of changes, enhancements, fixes and upgrade considerations.


## v1.8.2

This is a maintenance release:

* Bundles librdkafka v1.8.2
* Check termination channel while reading delivery reports (by @zjj)
* Added convenience method Consumer.StoreMessage() (@finncolman, #676)


confluent-kafka-go is based on librdkafka v1.8.2, see the
[librdkafka release notes](https://github.com/edenhill/librdkafka/releases/tag/v1.8.2)
for a complete list of changes, enhancements, fixes and upgrade considerations.


**Note**: There were no confluent-kafka-go v1.8.0 and v1.8.1 releases.


## v1.7.0

### Enhancements

* Experimental Windows support (by @neptoess).
Expand All @@ -22,6 +58,10 @@ for a complete list of changes, enhancements, fixes and upgrade considerations.
ReplicationFactor without specifying an explicit ReplicaAssignment, this is
now fixed.

confluent-kafka-go is based on librdkafka v1.7.0, see the
[librdkafka release notes](https://github.com/edenhill/librdkafka/releases/tag/v1.7.0)
for a complete list of changes, enhancements, fixes and upgrade considerations.



## v1.6.1
Expand Down
82 changes: 17 additions & 65 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ for the balanced consumer groups of Apache Kafka 0.9 and above.

See the [API documentation](http://docs.confluent.io/current/clients/confluent-kafka-go/index.html) for more information.

For a step-by-step guide on using the client see [Getting Started with Apache Kafka and Golang](https://developer.confluent.io/get-started/go/).



Examples
========
Expand Down Expand Up @@ -123,7 +126,7 @@ for use with [Confluent Cloud](https://www.confluent.io/confluent-cloud/).
Getting Started
===============

Supports Go 1.11+ and librdkafka 1.6.0+.
Supports Go 1.11+ and librdkafka 1.9.0+.

Using Go Modules
----------------
Expand Down Expand Up @@ -155,17 +158,14 @@ your `go.mod` file.
Install the client
------------------

If Go modules can't be used we recommend that you version pin the
confluent-kafka-go import to `v1` using gopkg.in:

Manual install:
```bash
go get -u gopkg.in/confluentinc/confluent-kafka-go.v1/kafka
go get -u github.com/confluentinc/confluent-kafka-go/kafka
```

Golang import:
```golang
import "gopkg.in/confluentinc/confluent-kafka-go.v1/kafka"
import "github.com/confluentinc/confluent-kafka-go/kafka"
```

librdkafka
Expand Down Expand Up @@ -218,87 +218,34 @@ with `-tags dynamic`.
**Note:** If you use the `master` branch of the Go client, then you need to use
the `master` branch of librdkafka.

**confluent-kafka-go requires librdkafka v1.6.0 or later.**
**confluent-kafka-go requires librdkafka v1.9.0 or later.**


API Strands
===========

There are two main API strands: function and channel-based.
The recommended API strand is the Function-Based one,
the Channel-Based one is documented in [examples/legacy](examples/legacy).

Function-Based Consumer
-----------------------

Messages, errors and events are polled through the `consumer.Poll()` function.

Pros:

* More direct mapping to underlying librdkafka functionality.

Cons:

* Makes it harder to read from multiple channels, but a go-routine easily
solves that (see Cons in channel-based consumer below about outdated events).
* Slower than the channel consumer.
It has direct mapping to underlying librdkafka functionality.

See [examples/consumer_example](examples/consumer_example)

Channel-Based Consumer (deprecated)
-----------------------------------

*Deprecated*: The channel-based consumer is deprecated due to the channel issues
mentioned below. Use the function-based consumer.

Messages, errors and events are posted on the `consumer.Events()` channel
for the application to read.

Pros:

* Possibly more Golang:ish
* Makes reading from multiple channels easy
* Fast

Cons:

* Outdated events and messages may be consumed due to the buffering nature
of channels. The extent is limited, but not remedied, by the Events channel
buffer size (`go.events.channel.size`).

See [examples/consumer_channel_example](examples/consumer_channel_example)

Channel-Based Producer
----------------------

Application writes messages to the `producer.ProducerChannel()`.
Delivery reports are emitted on the `producer.Events()` or specified private channel.

Pros:

* Go:ish
* Proper channel backpressure if librdkafka internal queue is full.

Cons:

* Double queueing: messages are first queued in the channel (size is configurable)
and then inside librdkafka.

See [examples/producer_channel_example](examples/producer_channel_example)

Function-Based Producer
-----------------------

Application calls `producer.Produce()` to produce messages.
Delivery reports are emitted on the `producer.Events()` or specified private channel.

Pros:

* Go:ish

Cons:
_Warnings_

* `Produce()` is a non-blocking call, if the internal librdkafka queue is full
the call will fail.
* Somewhat slower than the channel producer.
the call will fail and can be retried.

See [examples/producer_example](examples/producer_example)

Expand All @@ -319,3 +266,8 @@ See [kafka/README](kafka/README.md)
Contributions to the code, examples, documentation, et.al, are very much appreciated.

Make your changes, run `gofmt`, tests, etc, push your branch, create a PR, and [sign the CLA](http://clabot.confluent.io/cla).

Confluent Cloud
===============

For a step-by-step guide on using the Golang client with Confluent Cloud see [Getting Started with Apache Kafka and Golang](https://developer.confluent.io/get-started/go/) on [Confluent Developer](https://developer.confluent.io/).
23 changes: 17 additions & 6 deletions examples/.gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
consumer_channel_example/consumer_channel_example
admin_create_acls/admin_create_acls
admin_create_topic/admin_create_topic
admin_delete_acls/admin_delete_acls
admin_delete_topics/admin_delete_topics
admin_describe_acls/admin_describe_acls
admin_describe_config/admin_describe_config
confluent_cloud_example/confluent_cloud_example
consumer_example/consumer_example
consumer_offset_metadata/consumer_offset_metadata
producer_channel_example/producer_channel_example
producer_example/producer_example
cooperative_consumer_example/cooperative_consumer_example
go-kafkacat/go-kafkacat
admin_describe_config/admin_describe_config
admin_delete_topics/admin_delete_topics
admin_create_topic/admin_create_topic
idempotent_producer_example/idempotent_producer_example
legacy/consumer_channel_example/consumer_channel_example
legacy/producer_channel_example/producer_channel_example
library-version/library-version
mockcluster_example/mockcluster_example
oauthbearer_example/oauthbearer_example
producer_custom_channel_example/producer_custom_channel_example
producer_example/producer_example
stats_example/stats_example
transactions_example/transactions_example
Loading