Skip to content

Commit 047cc27

Browse files
committed
[FAB-2936] Vendor latest version of sarama library
https://jira.hyperledger.org/browse/FAB-2936 This is the first in a series of changesets that will allow us to quickly query the state of the Kafka cluster. This is itself needed so that we can decide whether there's a point in repeating a certain request (e.g. for the creation of a channel/partition in Kafka) or not. We're vendoring the latest version of the sarama library because it introduces the `Brokers()` method to the `Client` interface, and this allows us to easily get the list of active brokers. This changeset also adds a relevant (and now req'd) config setting, see: IBM/sarama#816 for more. Change-Id: Ia6bda8f237e087066f404f09f9d6ac359ed44b85 Signed-off-by: Kostas Christidis <[email protected]>
1 parent 24ab51a commit 047cc27

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+2289
-181
lines changed

orderer/kafka/util.go

+9-6
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,19 @@ func newBrokerConfig(kafkaVersion sarama.KafkaVersion, chosenStaticPartition int
5353
}
5454
}
5555

56+
// Set equivalent of Kafka producer config max.request.bytes to the default
57+
// value of a Kafka broker's socket.request.max.bytes property (100 MiB).
58+
brokerConfig.Producer.MaxMessageBytes = int(sarama.MaxRequestSize)
59+
// A partitioner is actually not needed the way we do things now,
60+
// but we're adding it now to allow for flexibility in the future.
61+
brokerConfig.Producer.Partitioner = newStaticPartitioner(chosenStaticPartition)
5662
// Set the level of acknowledgement reliability needed from the broker.
5763
// WaitForAll means that the partition leader will wait till all ISRs
5864
// got the message before sending back an ACK to the sender.
5965
brokerConfig.Producer.RequiredAcks = sarama.WaitForAll
60-
// A partitioner is actually not needed the way we do things now,
61-
// but we're adding it now to allow for flexibility in the future.
62-
brokerConfig.Producer.Partitioner = newStaticPartitioner(chosenStaticPartition)
63-
// Set equivalent of Kafka producer config max.request.bytes to the default
64-
// value of a Kafka broker's socket.request.max.bytes property (100 MiB).
65-
brokerConfig.Producer.MaxMessageBytes = int(sarama.MaxRequestSize)
66+
// An esoteric setting required by the sarama library, see:
67+
// https://github.com/Shopify/sarama/issues/816
68+
brokerConfig.Producer.Return.Successes = true
6669

6770
brokerConfig.Version = kafkaVersion
6871

vendor/github.com/Shopify/sarama/CHANGELOG.md

+52
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/Shopify/sarama/README.md

+4-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/Shopify/sarama/Vagrantfile

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/Shopify/sarama/api_versions_response.go

+4-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/Shopify/sarama/async_producer.go

+11-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)