Brak opisu

Diego Alvarez 052b8500ca fix error message s/CommitInterval/AutoCommit.Interval 4 lat temu
.github bcc00ae23d Test against kafka 2.2 4 lat temu
examples 5302f4bb5e Update documentation with Sarama instead of Sarma 5 lat temu
mocks 8a09106c11 fix incorrect SetTopicMetadata name mentions (introduced in 2052bd9) 5 lat temu
tools be7de1e156 add header to kafka-console-producer 5 lat temu
vagrant 49a563683f Fix possible faulty metrics in TestFuncProducing* (#1545) 5 lat temu
.gitignore 151daaac97 Addressing feeback 6 lat temu
.golangci.yml 07ff436a6d Fix linter errors 4 lat temu
CHANGELOG.md 829da79154 Adds changelog for 1.26.0 4 lat temu
LICENSE 8da9fa72b8 Technically Shopify owns the repo 6 lat temu
Makefile b8c5f7cfe1 Add GitHub Actions workflows, use golangci-lint 4 lat temu
README.md 0adc8d5a15 Add support for kafka 2.4.0 5 lat temu
Vagrantfile b8c5f7cfe1 Add GitHub Actions workflows, use golangci-lint 4 lat temu
acl_bindings.go 29d30a3c4c Refactor misspelled word Resouce to Resource 5 lat temu
acl_create_request.go 3328055d57 another pull request to please lint gods 5 lat temu
acl_create_request_test.go 29d30a3c4c Refactor misspelled word Resouce to Resource 5 lat temu
acl_create_response.go 3328055d57 another pull request to please lint gods 5 lat temu
acl_create_response_test.go 86d6f390cf add Describe/Create/DeleteAcls 7 lat temu
acl_delete_request.go 3328055d57 another pull request to please lint gods 5 lat temu
acl_delete_request_test.go 66abce6c25 Implements v1 of {Create,Describe,Delete}AclRequest 5 lat temu
acl_delete_response.go 3328055d57 another pull request to please lint gods 5 lat temu
acl_delete_response_test.go 86d6f390cf add Describe/Create/DeleteAcls 7 lat temu
acl_describe_request.go 3328055d57 another pull request to please lint gods 5 lat temu
acl_describe_request_test.go 66abce6c25 Implements v1 of {Create,Describe,Delete}AclRequest 5 lat temu
acl_describe_response.go 3328055d57 another pull request to please lint gods 5 lat temu
acl_describe_response_test.go 86d6f390cf add Describe/Create/DeleteAcls 7 lat temu
acl_filter.go 66abce6c25 Implements v1 of {Create,Describe,Delete}AclRequest 5 lat temu
acl_types.go 483263c182 using iota for constants and some style fixes 5 lat temu
add_offsets_to_txn_request.go 3328055d57 another pull request to please lint gods 5 lat temu
add_offsets_to_txn_request_test.go d81319704e add transaction-related request/responses (22, 24, 25, 26, 28) 6 lat temu
add_offsets_to_txn_response.go 3328055d57 another pull request to please lint gods 5 lat temu
add_offsets_to_txn_response_test.go d81319704e add transaction-related request/responses (22, 24, 25, 26, 28) 6 lat temu
add_partitions_to_txn_request.go 3328055d57 another pull request to please lint gods 5 lat temu
add_partitions_to_txn_request_test.go 07ff436a6d Fix linter errors 4 lat temu
add_partitions_to_txn_response.go 3328055d57 another pull request to please lint gods 5 lat temu
add_partitions_to_txn_response_test.go 07ff436a6d Fix linter errors 4 lat temu
admin.go 07ff436a6d Fix linter errors 4 lat temu
admin_test.go 07ff436a6d Fix linter errors 4 lat temu
alter_configs_request.go 3328055d57 another pull request to please lint gods 5 lat temu
alter_configs_request_test.go 07ff436a6d Fix linter errors 4 lat temu
alter_configs_response.go 3328055d57 another pull request to please lint gods 5 lat temu
alter_configs_response_test.go 07ff436a6d Fix linter errors 4 lat temu
api_versions_request.go 3328055d57 another pull request to please lint gods 5 lat temu
api_versions_request_test.go c5f4248429 Add support for latest protocol messages 8 lat temu
api_versions_response.go 3328055d57 another pull request to please lint gods 5 lat temu
api_versions_response_test.go 37654da7e1 Add support for decoding versioned responses 8 lat temu
async_producer.go 9f8650a8fa fix brokerProducer goroutine leak (#1442) 5 lat temu
async_producer_test.go 07ff436a6d Fix linter errors 4 lat temu
balance_strategy.go b29086bdaa Change type of unvisitedPartitions from []string to bool to economize 5 lat temu
balance_strategy_test.go 07ff436a6d Fix linter errors 4 lat temu
broker.go 07ff436a6d Fix linter errors 4 lat temu
broker_test.go 07ff436a6d Fix linter errors 4 lat temu
client.go 07ff436a6d Fix linter errors 4 lat temu
client_test.go fe1b1849d0 Support timeout when fetching metadata 5 lat temu
client_tls_test.go 07ff436a6d Fix linter errors 4 lat temu
compress.go c65bdddf6c Remove cgo zstd package 5 lat temu
config.go 052b8500ca fix error message s/CommitInterval/AutoCommit.Interval 4 lat temu
config_resource_type.go fb8b9b5a10 fix: use the broker for any admin on BrokerConfig 4 lat temu
config_test.go 07ff436a6d Fix linter errors 4 lat temu
consumer.go 37faed7ffc enables zstd bumping the right things 4 lat temu
consumer_group.go 33aa349ead Merge pull request #1581 from matthewloring/deadlock-fix 4 lat temu
consumer_group_members.go 12fa6736bd fixed some typo and added some comments 6 lat temu
consumer_group_members_test.go cecb3d9807 Formating all files with gofmt -s 7 lat temu
consumer_group_test.go a318f6ee7d CI test fixes 6 lat temu
consumer_metadata_request.go 12fa6736bd fixed some typo and added some comments 6 lat temu
consumer_metadata_request_test.go a5a9b835af refactor ConsumerMetadataRequest/Response to FindCoordinatorRequest/Response 7 lat temu
consumer_metadata_response.go 3006055aad simple typo fixes in consumer metadata response file 6 lat temu
consumer_metadata_response_test.go e6c029ff1a Revert "Synced error names and descriptions with the kafka's protocol" 5 lat temu
consumer_test.go b5630e543b bug: handle and log throttled FetchResponses 5 lat temu
control_record.go 3328055d57 another pull request to please lint gods 5 lat temu
control_record_test.go 57215a08ac midway on consumer test 5 lat temu
crc32_field.go 47ae433aa8 Reuse lengthFields 5 lat temu
create_partitions_request.go 7957e72eca factor out getStringLength, use putArrayLength 7 lat temu
create_partitions_request_test.go 07ff436a6d Fix linter errors 4 lat temu
create_partitions_response.go ec2cbc3814 Satisfy the error interface in create responses 5 lat temu
create_partitions_response_test.go 07ff436a6d Fix linter errors 4 lat temu
create_topics_request.go b5ace411a0 add CreateTopicsRequest/Response 7 lat temu
create_topics_request_test.go 07ff436a6d Fix linter errors 4 lat temu
create_topics_response.go ec2cbc3814 Satisfy the error interface in create responses 5 lat temu
create_topics_response_test.go 07ff436a6d Fix linter errors 4 lat temu
decompress.go f352e5cc8b Reuse compression writer objects 6 lat temu
delete_groups_request.go 0f1c3e9b87 Add support for DeleteGroups 6 lat temu
delete_groups_request_test.go 0f1c3e9b87 Add support for DeleteGroups 6 lat temu
delete_groups_response.go 7d531e2557 Use native time type for ThrottleTime 6 lat temu
delete_groups_response_test.go 7d531e2557 Use native time type for ThrottleTime 6 lat temu
delete_records_request.go 76a6b90ec2 Add DeleteRecords operation to Broker 6 lat temu
delete_records_request_test.go 76a6b90ec2 Add DeleteRecords operation to Broker 6 lat temu
delete_records_response.go 76a6b90ec2 Add DeleteRecords operation to Broker 6 lat temu
delete_records_response_test.go 76a6b90ec2 Add DeleteRecords operation to Broker 6 lat temu
delete_topics_request.go 796e8cc60f Added support for DeleteTopicsRequest V1 6 lat temu
delete_topics_request_test.go 796e8cc60f Added support for DeleteTopicsRequest V1 6 lat temu
delete_topics_response.go 620549d3ed add DeleteTopicsRequest/Response 7 lat temu
delete_topics_response_test.go 620549d3ed add DeleteTopicsRequest/Response 7 lat temu
describe_configs_request.go 11800fbad1 Set correct Kafka version for DescribeConfigsRequest v1 5 lat temu
describe_configs_request_test.go 07ff436a6d Fix linter errors 4 lat temu
describe_configs_response.go 07ff436a6d Fix linter errors 4 lat temu
describe_configs_response_test.go 07ff436a6d Fix linter errors 4 lat temu
describe_groups_request.go 90a4cc632e Fix race in broker version check 8 lat temu
describe_groups_request_test.go 1621c4959a Add tests for all new request types. 9 lat temu
describe_groups_response.go fdebee00c4 Following Golint tips for if blocks who ends with a return 7 lat temu
describe_groups_response_test.go 37654da7e1 Add support for decoding versioned responses 8 lat temu
describe_log_dirs_request.go c3d174d3a2 Fix request decode 5 lat temu
describe_log_dirs_request_test.go 07ff436a6d Fix linter errors 4 lat temu
describe_log_dirs_response.go 91ff84ae8d Use KError for ErrorCodes 5 lat temu
describe_log_dirs_response_test.go 07ff436a6d Fix linter errors 4 lat temu
dev.yml 0adc8d5a15 Add support for kafka 2.4.0 5 lat temu
encoder_decoder.go 124e7c647e Expose producer metrics with go-metrics 8 lat temu
end_txn_request.go d81319704e add transaction-related request/responses (22, 24, 25, 26, 28) 6 lat temu
end_txn_request_test.go d81319704e add transaction-related request/responses (22, 24, 25, 26, 28) 6 lat temu
end_txn_response.go d81319704e add transaction-related request/responses (22, 24, 25, 26, 28) 6 lat temu
end_txn_response_test.go d81319704e add transaction-related request/responses (22, 24, 25, 26, 28) 6 lat temu
errors.go fbe15c34cf Handle a few missed protocol errors and add the new one 5 lat temu
fetch_request.go 1799d6c8db fix: fill in the Fetch{Request,Response} protocol 4 lat temu
fetch_request_test.go 1799d6c8db fix: fill in the Fetch{Request,Response} protocol 4 lat temu
fetch_response.go 07ff436a6d Fix linter errors 4 lat temu
fetch_response_test.go 07ff436a6d Fix linter errors 4 lat temu
find_coordinator_request.go 483263c182 using iota for constants and some style fixes 5 lat temu
find_coordinator_request_test.go a5a9b835af refactor ConsumerMetadataRequest/Response to FindCoordinatorRequest/Response 7 lat temu
find_coordinator_response.go 5a23d49f7a remove rack from FindCoordinatorResponse and hardcode Broker-decode/encode version to 0 6 lat temu
find_coordinator_response_test.go e6c029ff1a Revert "Synced error names and descriptions with the kafka's protocol" 5 lat temu
functional_client_test.go e931cc00ed Stop test if client.Coordinator fails somehow 8 lat temu
functional_consumer_group_test.go a318f6ee7d CI test fixes 6 lat temu
functional_consumer_test.go 37faed7ffc enables zstd bumping the right things 4 lat temu
functional_offset_manager_test.go ccab789d44 OffsetManager: match upstream mark/next behaviour 8 lat temu
functional_producer_test.go 07ff436a6d Fix linter errors 4 lat temu
functional_test.go 2c40df751c Fix version.satisfies so all tests run against 0.9 9 lat temu
go.mod 8f8380c072 Update compress 4 lat temu
go.sum 8f8380c072 Update compress 4 lat temu
gssapi_kerberos.go 07ff436a6d Fix linter errors 4 lat temu
heartbeat_request.go 90a4cc632e Fix race in broker version check 8 lat temu
heartbeat_request_test.go 1621c4959a Add tests for all new request types. 9 lat temu
heartbeat_response.go fdebee00c4 Following Golint tips for if blocks who ends with a return 7 lat temu
heartbeat_response_test.go 37654da7e1 Add support for decoding versioned responses 8 lat temu
init_producer_id_request.go d81319704e add transaction-related request/responses (22, 24, 25, 26, 28) 6 lat temu
init_producer_id_request_test.go d81319704e add transaction-related request/responses (22, 24, 25, 26, 28) 6 lat temu
init_producer_id_response.go d81319704e add transaction-related request/responses (22, 24, 25, 26, 28) 6 lat temu
init_producer_id_response_test.go d81319704e add transaction-related request/responses (22, 24, 25, 26, 28) 6 lat temu
join_group_request.go e1b85f3400 Added versioning for join-group requests and responses 6 lat temu
join_group_request_test.go e1b85f3400 Added versioning for join-group requests and responses 6 lat temu
join_group_response.go e1b85f3400 Added versioning for join-group requests and responses 6 lat temu
join_group_response_test.go e1b85f3400 Added versioning for join-group requests and responses 6 lat temu
kerberos_client.go 3ec45e581a Add kerberos support 5 lat temu
kerberos_client_test.go 3ec45e581a Add kerberos support 5 lat temu
leave_group_request.go 90a4cc632e Fix race in broker version check 8 lat temu
leave_group_request_test.go 1621c4959a Add tests for all new request types. 9 lat temu
leave_group_response.go fdebee00c4 Following Golint tips for if blocks who ends with a return 7 lat temu
leave_group_response_test.go e6c029ff1a Revert "Synced error names and descriptions with the kafka's protocol" 5 lat temu
length_field.go 47ae433aa8 Reuse lengthFields 5 lat temu
list_groups_request.go 90a4cc632e Fix race in broker version check 8 lat temu
list_groups_request_test.go 1621c4959a Add tests for all new request types. 9 lat temu
list_groups_response.go fdebee00c4 Following Golint tips for if blocks who ends with a return 7 lat temu
list_groups_response_test.go 37654da7e1 Add support for decoding versioned responses 8 lat temu
message.go 07ff436a6d Fix linter errors 4 lat temu
message_set.go 47ae433aa8 Reuse lengthFields 5 lat temu
message_test.go 7d77064a4d Revert "Add workaround for an empty zstd message" 6 lat temu
metadata_request.go c547697705 bug: V5 MetadataRequest nullable topics array 5 lat temu
metadata_request_test.go c547697705 bug: V5 MetadataRequest nullable topics array 5 lat temu
metadata_response.go 07ff436a6d Fix linter errors 4 lat temu
metadata_response_test.go e6c029ff1a Revert "Synced error names and descriptions with the kafka's protocol" 5 lat temu
metrics.go 82be3b4da9 Unregister all broker metrics on broker stop 6 lat temu
metrics_test.go 124e7c647e Expose producer metrics with go-metrics 8 lat temu
mockbroker.go 07ff436a6d Fix linter errors 4 lat temu
mockkerberos.go 3ec45e581a Add kerberos support 5 lat temu
mockresponses.go 5de8dba37c fix: set DescribeConfigRequest Version field 4 lat temu
offset_commit_request.go c8f961f633 Address a few staticcheck suggestions 5 lat temu
offset_commit_request_test.go 3f16fb0e7a Add support for newer OffsetCommit request/response 6 lat temu
offset_commit_response.go 3f16fb0e7a Add support for newer OffsetCommit request/response 6 lat temu
offset_commit_response_test.go 3f16fb0e7a Add support for newer OffsetCommit request/response 6 lat temu
offset_fetch_request.go 6c7918ef5a Added OffsetFetch support up to v5 6 lat temu
offset_fetch_request_test.go 6c7918ef5a Added OffsetFetch support up to v5 6 lat temu
offset_fetch_response.go 6c7918ef5a Added OffsetFetch support up to v5 6 lat temu
offset_fetch_response_test.go 6c7918ef5a Added OffsetFetch support up to v5 6 lat temu
offset_manager.go 07ff436a6d Fix linter errors 4 lat temu
offset_manager_test.go 07ff436a6d Fix linter errors 4 lat temu
offset_request.go 374f0e3cd0 Use a boolean to check that replica ID was set 6 lat temu
offset_request_test.go 8869e903fa Add a getter for replica ID 6 lat temu
offset_response.go e42dc76c4e Add missing Kafka versions 6 lat temu
offset_response_test.go d65b3fd46b Support ListOffsetRequest v1 [KIP-79] 8 lat temu
packet_decoder.go 4ed1ab2ab8 Provide peekInt8 to reduce allocations 5 lat temu
packet_encoder.go b3f149d4d2 add create partitions 7 lat temu
partitioner.go a74fb772b5 update name of partitioner option so it makes more sense 6 lat temu
partitioner_test.go 9b2c4d6e2c Make Partitioner.RequiresConsistency vary per-message 6 lat temu
prep_encoder.go b3f149d4d2 add create partitions 7 lat temu
produce_request.go 37faed7ffc enables zstd bumping the right things 4 lat temu
produce_request_test.go 7ad9a62d7d Fix TestProduceRequest 6 lat temu
produce_response.go 37faed7ffc enables zstd bumping the right things 4 lat temu
produce_response_test.go 37faed7ffc enables zstd bumping the right things 4 lat temu
produce_set.go 37faed7ffc enables zstd bumping the right things 4 lat temu
produce_set_test.go 07ff436a6d Fix linter errors 4 lat temu
real_decoder.go dec71e97e5 Remove use of magic number 5 lat temu
real_encoder.go b3f149d4d2 add create partitions 7 lat temu
record.go b68420a29b control record + isTransactional bit parsing 5 lat temu
record_batch.go 47ae433aa8 Reuse lengthFields 5 lat temu
record_test.go 780ea152be Fix gzip compression encode/decode test 6 lat temu
records.go 4ed1ab2ab8 Provide peekInt8 to reduce allocations 5 lat temu
records_test.go 6b86562f5c ut transactional flag 5 lat temu
request.go 1799d6c8db fix: fill in the Fetch{Request,Response} protocol 4 lat temu
request_test.go f4fbc32080 Simple validation of required version 6 lat temu
response_header.go 55578535cf Add SASL SCRAM-SHA-512 and SCRAM-SHA-256 mechanismes 5 lat temu
response_header_test.go 893044d278 Fix Golint errors, except for all the missing comments. 11 lat temu
sarama.go 483263c182 using iota for constants and some style fixes 5 lat temu
sasl_authenticate_request.go 56ffac20e5 Clean up error handling 5 lat temu
sasl_authenticate_request_test.go daa6ff523d Fix SaslAuthenticateRequest 5 lat temu
sasl_authenticate_response.go 56ffac20e5 Clean up error handling 5 lat temu
sasl_authenticate_response_test.go 07ff436a6d Fix linter errors 4 lat temu
sasl_handshake_request.go f5b3e0ed01 Implement SASL/OAUTHBEARER support 6 lat temu
sasl_handshake_request_test.go c5f4248429 Add support for latest protocol messages 8 lat temu
sasl_handshake_response.go fdebee00c4 Following Golint tips for if blocks who ends with a return 7 lat temu
sasl_handshake_response_test.go 37654da7e1 Add support for decoding versioned responses 8 lat temu
sticky_assignor_user_data.go 01915cf82e Add sticky partition assignor 5 lat temu
sticky_assignor_user_data_test.go 01915cf82e Add sticky partition assignor 5 lat temu
sync_group_request.go 124e7c647e Expose producer metrics with go-metrics 8 lat temu
sync_group_request_test.go 1621c4959a Add tests for all new request types. 9 lat temu
sync_group_response.go fdebee00c4 Following Golint tips for if blocks who ends with a return 7 lat temu
sync_group_response_test.go 37654da7e1 Add support for decoding versioned responses 8 lat temu
sync_producer.go 1e2740380a Do not modify ProducerMessage.MetaData during the whole publishing process. 6 lat temu
sync_producer_test.go e3ecf7b088 added offline replicas operation to client for kafka version >= 1.x 5 lat temu
timestamp.go ed80c61d79 Make timestamp fields of type time.Time and time.Duration 7 lat temu
txn_offset_commit_request.go d81319704e add transaction-related request/responses (22, 24, 25, 26, 28) 6 lat temu
txn_offset_commit_request_test.go 07ff436a6d Fix linter errors 4 lat temu
txn_offset_commit_response.go d81319704e add transaction-related request/responses (22, 24, 25, 26, 28) 6 lat temu
txn_offset_commit_response_test.go 07ff436a6d Fix linter errors 4 lat temu
utils.go 0adc8d5a15 Add support for kafka 2.4.0 5 lat temu
utils_test.go a709f2d5ca String functions for KafkaVersion (#989) 7 lat temu
zstd.go 2fbc232314 Remove double newline 5 lat temu

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