Skip to content
Sarama is a Go library for Apache Kafka 0.8, and up.
Go Other
  1. Go 99.2%
  2. Other 0.8%
Branch: master
Clone or download
bai Merge pull request #1573 from Shopify/github-actions
Add GitHub Actions workflows, use golangci-lint
Latest commit 94173f8 Jan 28, 2020
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Test against kafka 2.2 Jan 28, 2020
examples Update documentation with Sarama instead of Sarma Sep 30, 2019
mocks fix incorrect SetTopicMetadata name mentions (introduced in 2052bd9) Nov 5, 2019
tools add header to kafka-console-producer Nov 25, 2019
vagrant Fix possible faulty metrics in TestFuncProducing* (#1545) Nov 22, 2019
.gitignore Addressing feeback Jul 12, 2018
.golangci.yml Fix linter errors Jan 27, 2020
CHANGELOG.md Adds changelog for 1.26.0 Jan 24, 2020
LICENSE Technically Shopify owns the repo Apr 2, 2018
Makefile Add GitHub Actions workflows, use golangci-lint Jan 27, 2020
README.md Add support for kafka 2.4.0 Dec 3, 2019
Vagrantfile Add GitHub Actions workflows, use golangci-lint Jan 27, 2020
acl_bindings.go Refactor misspelled word Resouce to Resource May 15, 2019
acl_create_request.go another pull request to please lint gods Apr 8, 2019
acl_create_request_test.go Refactor misspelled word Resouce to Resource May 15, 2019
acl_create_response.go another pull request to please lint gods Apr 8, 2019
acl_create_response_test.go add Describe/Create/DeleteAcls Dec 21, 2017
acl_delete_request.go another pull request to please lint gods Apr 8, 2019
acl_delete_request_test.go Implements v1 of {Create,Describe,Delete}AclRequest Feb 19, 2019
acl_delete_response.go another pull request to please lint gods Apr 8, 2019
acl_delete_response_test.go add Describe/Create/DeleteAcls Dec 21, 2017
acl_describe_request.go another pull request to please lint gods Apr 8, 2019
acl_describe_request_test.go Implements v1 of {Create,Describe,Delete}AclRequest Feb 19, 2019
acl_describe_response.go another pull request to please lint gods Apr 8, 2019
acl_describe_response_test.go add Describe/Create/DeleteAcls Dec 21, 2017
acl_filter.go Implements v1 of {Create,Describe,Delete}AclRequest Feb 19, 2019
acl_types.go using iota for constants and some style fixes Mar 13, 2019
add_offsets_to_txn_request.go another pull request to please lint gods Apr 8, 2019
add_offsets_to_txn_request_test.go add transaction-related request/responses (22, 24, 25, 26, 28) Jan 25, 2018
add_offsets_to_txn_response.go another pull request to please lint gods Apr 8, 2019
add_offsets_to_txn_response_test.go add transaction-related request/responses (22, 24, 25, 26, 28) Jan 25, 2018
add_partitions_to_txn_request.go another pull request to please lint gods Apr 8, 2019
add_partitions_to_txn_request_test.go Fix linter errors Jan 27, 2020
add_partitions_to_txn_response.go another pull request to please lint gods Apr 8, 2019
add_partitions_to_txn_response_test.go Fix linter errors Jan 27, 2020
admin.go Fix linter errors Jan 27, 2020
admin_test.go Fix linter errors Jan 27, 2020
alter_configs_request.go another pull request to please lint gods Apr 8, 2019
alter_configs_request_test.go Fix linter errors Jan 27, 2020
alter_configs_response.go another pull request to please lint gods Apr 8, 2019
alter_configs_response_test.go Fix linter errors Jan 27, 2020
api_versions_request.go another pull request to please lint gods Apr 8, 2019
api_versions_request_test.go Add support for latest protocol messages Jun 9, 2016
api_versions_response.go another pull request to please lint gods Apr 8, 2019
api_versions_response_test.go Add support for decoding versioned responses Jun 9, 2016
async_producer.go fix brokerProducer goroutine leak (#1442) Aug 8, 2019
async_producer_test.go Fix linter errors Jan 27, 2020
balance_strategy.go Change type of unvisitedPartitions from []string to bool to economize Aug 14, 2019
balance_strategy_test.go Fix linter errors Jan 27, 2020
broker.go Fix linter errors Jan 27, 2020
broker_test.go Fix linter errors Jan 27, 2020
client.go Fix linter errors Jan 27, 2020
client_test.go Support timeout when fetching metadata Apr 23, 2019
client_tls_test.go Fix linter errors Jan 27, 2020
compress.go Remove cgo zstd package Sep 3, 2019
config.go fix: retry topic request on ControllerNotAvailable Jan 24, 2020
config_resource_type.go fix: use the broker for any admin on BrokerConfig Jan 15, 2020
config_test.go Fix linter errors Jan 27, 2020
consumer.go enables zstd bumping the right things Jan 21, 2020
consumer_group.go Merge pull request #1581 from matthewloring/deadlock-fix Jan 22, 2020
consumer_group_members.go fixed some typo and added some comments Nov 28, 2018
consumer_group_members_test.go Formating all files with gofmt -s Feb 7, 2017
consumer_group_test.go CI test fixes Sep 27, 2018
consumer_metadata_request.go fixed some typo and added some comments Nov 28, 2018
consumer_metadata_request_test.go refactor ConsumerMetadataRequest/Response to FindCoordinatorRequest/R… Dec 20, 2017
consumer_metadata_response.go simple typo fixes in consumer metadata response file Dec 27, 2018
consumer_metadata_response_test.go Revert "Synced error names and descriptions with the kafka's protocol" Jan 23, 2019
consumer_test.go bug: handle and log throttled FetchResponses May 29, 2019
control_record.go another pull request to please lint gods Apr 8, 2019
control_record_test.go midway on consumer test Mar 12, 2019
crc32_field.go Reuse lengthFields May 30, 2019
create_partitions_request.go factor out getStringLength, use putArrayLength Dec 5, 2017
create_partitions_request_test.go Fix linter errors Jan 27, 2020
create_partitions_response.go Satisfy the error interface in create responses Feb 11, 2019
create_partitions_response_test.go Fix linter errors Jan 27, 2020
create_topics_request.go add CreateTopicsRequest/Response Dec 20, 2017
create_topics_request_test.go Fix linter errors Jan 27, 2020
create_topics_response.go Satisfy the error interface in create responses Feb 11, 2019
create_topics_response_test.go Fix linter errors Jan 27, 2020
decompress.go Reuse compression writer objects Oct 5, 2018
delete_groups_request.go Add support for DeleteGroups May 3, 2018
delete_groups_request_test.go Add support for DeleteGroups May 3, 2018
delete_groups_response.go Use native time type for ThrottleTime May 4, 2018
delete_groups_response_test.go Use native time type for ThrottleTime May 4, 2018
delete_records_request.go Add DeleteRecords operation to Broker Feb 9, 2018
delete_records_request_test.go Add DeleteRecords operation to Broker Feb 9, 2018
delete_records_response.go Add DeleteRecords operation to Broker Feb 9, 2018
delete_records_response_test.go Add DeleteRecords operation to Broker Feb 9, 2018
delete_topics_request.go Added support for DeleteTopicsRequest V1 Feb 14, 2018
delete_topics_request_test.go Added support for DeleteTopicsRequest V1 Feb 14, 2018
delete_topics_response.go add DeleteTopicsRequest/Response Dec 21, 2017
delete_topics_response_test.go add DeleteTopicsRequest/Response Dec 21, 2017
describe_configs_request.go Set correct Kafka version for DescribeConfigsRequest v1 Feb 8, 2019
describe_configs_request_test.go Fix linter errors Jan 27, 2020
describe_configs_response.go Fix linter errors Jan 27, 2020
describe_configs_response_test.go Fix linter errors Jan 27, 2020
describe_groups_request.go Fix race in broker version check Jun 17, 2016
describe_groups_request_test.go Add tests for all new request types. Dec 8, 2015
describe_groups_response.go Following Golint tips for if blocks who ends with a return Feb 9, 2017
describe_groups_response_test.go Add support for decoding versioned responses Jun 9, 2016
describe_log_dirs_request.go Fix request decode Oct 26, 2019
describe_log_dirs_request_test.go Fix linter errors Jan 27, 2020
describe_log_dirs_response.go Use KError for ErrorCodes Oct 26, 2019
describe_log_dirs_response_test.go Fix linter errors Jan 27, 2020
dev.yml Add support for kafka 2.4.0 Dec 3, 2019
encoder_decoder.go Expose producer metrics with go-metrics Oct 25, 2016
end_txn_request.go add transaction-related request/responses (22, 24, 25, 26, 28) Jan 25, 2018
end_txn_request_test.go add transaction-related request/responses (22, 24, 25, 26, 28) Jan 25, 2018
end_txn_response.go add transaction-related request/responses (22, 24, 25, 26, 28) Jan 25, 2018
end_txn_response_test.go add transaction-related request/responses (22, 24, 25, 26, 28) Jan 25, 2018
errors.go Handle a few missed protocol errors and add the new one Aug 20, 2019
fetch_request.go fix: fill in the Fetch{Request,Response} protocol Jan 17, 2020
fetch_request_test.go fix: fill in the Fetch{Request,Response} protocol Jan 17, 2020
fetch_response.go Fix linter errors Jan 27, 2020
fetch_response_test.go Fix linter errors Jan 27, 2020
find_coordinator_request.go using iota for constants and some style fixes Mar 13, 2019
find_coordinator_request_test.go refactor ConsumerMetadataRequest/Response to FindCoordinatorRequest/R… Dec 20, 2017
find_coordinator_response.go remove rack from FindCoordinatorResponse and hardcode Broker-decode/e… Feb 14, 2018
find_coordinator_response_test.go Revert "Synced error names and descriptions with the kafka's protocol" Jan 23, 2019
functional_client_test.go Stop test if client.Coordinator fails somehow Oct 25, 2016
functional_consumer_group_test.go CI test fixes Sep 27, 2018
functional_consumer_test.go enables zstd bumping the right things Jan 21, 2020
functional_offset_manager_test.go OffsetManager: match upstream mark/next behaviour Jul 26, 2016
functional_producer_test.go Fix linter errors Jan 27, 2020
functional_test.go Fix version.satisfies so all tests run against 0.9 Nov 26, 2015
go.mod Update compress Jan 13, 2020
go.sum Update compress Jan 13, 2020
gssapi_kerberos.go Fix linter errors Jan 27, 2020
heartbeat_request.go Fix race in broker version check Jun 17, 2016
heartbeat_request_test.go Add tests for all new request types. Dec 8, 2015
heartbeat_response.go Following Golint tips for if blocks who ends with a return Feb 9, 2017
heartbeat_response_test.go Add support for decoding versioned responses Jun 9, 2016
init_producer_id_request.go add transaction-related request/responses (22, 24, 25, 26, 28) Jan 25, 2018
init_producer_id_request_test.go add transaction-related request/responses (22, 24, 25, 26, 28) Jan 25, 2018
init_producer_id_response.go add transaction-related request/responses (22, 24, 25, 26, 28) Jan 25, 2018
init_producer_id_response_test.go add transaction-related request/responses (22, 24, 25, 26, 28) Jan 25, 2018
join_group_request.go Added versioning for join-group requests and responses May 3, 2018
join_group_request_test.go Added versioning for join-group requests and responses May 3, 2018
join_group_response.go Added versioning for join-group requests and responses May 3, 2018
join_group_response_test.go Added versioning for join-group requests and responses May 3, 2018
kerberos_client.go Add kerberos support May 12, 2019
kerberos_client_test.go Add kerberos support May 12, 2019
leave_group_request.go Fix race in broker version check Jun 17, 2016
leave_group_request_test.go Add tests for all new request types. Dec 8, 2015
leave_group_response.go Following Golint tips for if blocks who ends with a return Feb 9, 2017
leave_group_response_test.go Revert "Synced error names and descriptions with the kafka's protocol" Jan 23, 2019
length_field.go Reuse lengthFields May 30, 2019
list_groups_request.go Fix race in broker version check Jun 17, 2016
list_groups_request_test.go Add tests for all new request types. Dec 8, 2015
list_groups_response.go Following Golint tips for if blocks who ends with a return Feb 9, 2017
list_groups_response_test.go Add support for decoding versioned responses Jun 9, 2016
message.go Fix linter errors Jan 27, 2020
message_set.go Reuse lengthFields May 30, 2019
message_test.go Revert "Add workaround for an empty zstd message" Oct 2, 2018
metadata_request.go bug: V5 MetadataRequest nullable topics array Apr 10, 2019
metadata_request_test.go bug: V5 MetadataRequest nullable topics array Apr 10, 2019
metadata_response.go Fix linter errors Jan 27, 2020
metadata_response_test.go Revert "Synced error names and descriptions with the kafka's protocol" Jan 23, 2019
metrics.go Unregister all broker metrics on broker stop Dec 7, 2018
metrics_test.go Expose producer metrics with go-metrics Oct 25, 2016
mockbroker.go Fix linter errors Jan 27, 2020
mockkerberos.go Add kerberos support May 12, 2019
mockresponses.go fix: set DescribeConfigRequest Version field Jan 16, 2020
offset_commit_request.go Address a few staticcheck suggestions Apr 1, 2019
offset_commit_request_test.go Add support for newer OffsetCommit request/response Oct 24, 2018
offset_commit_response.go Add support for newer OffsetCommit request/response Oct 24, 2018
offset_commit_response_test.go Add support for newer OffsetCommit request/response Oct 24, 2018
offset_fetch_request.go Added OffsetFetch support up to v5 Dec 5, 2018
offset_fetch_request_test.go Added OffsetFetch support up to v5 Dec 5, 2018
offset_fetch_response.go Added OffsetFetch support up to v5 Dec 5, 2018
offset_fetch_response_test.go Added OffsetFetch support up to v5 Dec 5, 2018
offset_manager.go Fix linter errors Jan 27, 2020
offset_manager_test.go Fix linter errors Jan 27, 2020
offset_request.go Use a boolean to check that replica ID was set Oct 26, 2018
offset_request_test.go Add a getter for replica ID Oct 26, 2018
offset_response.go Add missing Kafka versions Feb 13, 2018
offset_response_test.go Support ListOffsetRequest v1 [KIP-79] Oct 31, 2016
packet_decoder.go Provide peekInt8 to reduce allocations May 13, 2019
packet_encoder.go add create partitions Dec 4, 2017
partitioner.go update name of partitioner option so it makes more sense Jun 15, 2018
partitioner_test.go Make Partitioner.RequiresConsistency vary per-message Jun 14, 2018
prep_encoder.go add create partitions Dec 4, 2017
produce_request.go enables zstd bumping the right things Jan 21, 2020
produce_request_test.go Fix TestProduceRequest Feb 13, 2018
produce_response.go enables zstd bumping the right things Jan 21, 2020
produce_response_test.go enables zstd bumping the right things Jan 21, 2020
produce_set.go enables zstd bumping the right things Jan 21, 2020
produce_set_test.go Fix linter errors Jan 27, 2020
real_decoder.go Remove use of magic number May 14, 2019
real_encoder.go add create partitions Dec 4, 2017
record.go control record + isTransactional bit parsing Mar 10, 2019
record_batch.go Reuse lengthFields May 30, 2019
record_test.go Fix gzip compression encode/decode test Feb 13, 2018
records.go Provide peekInt8 to reduce allocations May 13, 2019
records_test.go ut transactional flag Mar 17, 2019
request.go fix: fill in the Fetch{Request,Response} protocol Jan 17, 2020
request_test.go Simple validation of required version Feb 14, 2018
response_header.go Add SASL SCRAM-SHA-512 and SCRAM-SHA-256 mechanismes Feb 27, 2019
response_header_test.go Fix Golint errors, except for all the missing comments. Aug 30, 2013
sarama.go using iota for constants and some style fixes Mar 13, 2019
sasl_authenticate_request.go Clean up error handling Jan 7, 2019
sasl_authenticate_request_test.go Fix SaslAuthenticateRequest Jan 7, 2019
sasl_authenticate_response.go Clean up error handling Jan 7, 2019
sasl_authenticate_response_test.go Fix linter errors Jan 27, 2020
sasl_handshake_request.go Implement SASL/OAUTHBEARER support Dec 23, 2018
sasl_handshake_request_test.go Add support for latest protocol messages Jun 9, 2016
sasl_handshake_response.go Following Golint tips for if blocks who ends with a return Feb 9, 2017
sasl_handshake_response_test.go Add support for decoding versioned responses Jun 9, 2016
sticky_assignor_user_data.go Add sticky partition assignor Jul 1, 2019
sticky_assignor_user_data_test.go Add sticky partition assignor Jul 1, 2019
sync_group_request.go Expose producer metrics with go-metrics Oct 25, 2016
sync_group_request_test.go Add tests for all new request types. Dec 8, 2015
sync_group_response.go Following Golint tips for if blocks who ends with a return Feb 9, 2017
sync_group_response_test.go Add support for decoding versioned responses Jun 9, 2016
sync_producer.go Do not modify ProducerMessage.MetaData during the whole publishing pr… Jun 2, 2018
sync_producer_test.go added offline replicas operation to client for kafka version >= 1.x Mar 17, 2019
timestamp.go Make timestamp fields of type time.Time and time.Duration Nov 1, 2017
txn_offset_commit_request.go add transaction-related request/responses (22, 24, 25, 26, 28) Jan 25, 2018
txn_offset_commit_request_test.go Fix linter errors Jan 27, 2020
txn_offset_commit_response.go add transaction-related request/responses (22, 24, 25, 26, 28) Jan 25, 2018
txn_offset_commit_response_test.go Fix linter errors Jan 27, 2020
utils.go Add support for kafka 2.4.0 Dec 3, 2019
utils_test.go String functions for KafkaVersion (#989) Nov 27, 2017
zstd.go Remove double newline Sep 6, 2019

README.md

sarama

GoDoc Build Status Coverage

Sarama is an MIT-licensed Go client library for Apache Kafka version 0.8 (and later).

Getting started

  • API documentation and examples are available via godoc.
  • Mocks for testing are available in the mocks subpackage.
  • The examples directory contains more elaborate example applications.
  • The tools directory contains command line tools that can be useful for testing, diagnostics, and instrumentation.

You might also want to look at the Frequently Asked Questions.

Compatibility and API stability

Sarama provides a "2 releases + 2 months" compatibility guarantee: we support the two latest stable releases of Kafka and Go, and we provide a two month grace period for older releases. This means we currently officially support Go 1.12 through 1.13, and Kafka 2.1 through 2.4, although older releases are still likely to work.

Sarama follows semantic versioning and provides API stability via the gopkg.in service. You can import a version with a guaranteed stable API via http://gopkg.in/Shopify/sarama.v1. A changelog is available here.

Contributing

You can’t perform that action at this time.