Skip to content

Commit

Permalink
Merge pull request #240 from Shopify/tighten-config-validation
Browse files Browse the repository at this point in the history
producer: check MaxMessagesPerReq >= FlushMsgCount
  • Loading branch information
eapache committed Dec 19, 2014
2 parents 03ad601 + 4a244b5 commit 950d619
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ func (config *ProducerConfig) Validate() error {
Logger.Println("ProducerConfig.MaxMessageBytes too close to MaxRequestSize; it will be ignored.")
}

if config.MaxMessagesPerReq < 0 {
return ConfigurationError("Invalid MaxMessagesPerReq")
if config.MaxMessagesPerReq < 0 || (config.MaxMessagesPerReq > 0 && config.MaxMessagesPerReq < config.FlushMsgCount) {
return ConfigurationError("Invalid MaxMessagesPerReq, must be non-negative and >= FlushMsgCount if set")
}

if config.RetryBackoff < 0 {
Expand Down
2 changes: 1 addition & 1 deletion vagrant/install_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ KAFKA_VERSION=0.8.1.1

mkdir -p ${KAFKA_INSTALL_ROOT}
if [ ! -f ${KAFKA_INSTALL_ROOT}/kafka-${KAFKA_VERSION}.tgz ]; then
wget --quiet http://apache.mirror.nexicom.net/kafka/${KAFKA_VERSION}/kafka_2.10-${KAFKA_VERSION}.tgz -O ${KAFKA_INSTALL_ROOT}/kafka-${KAFKA_VERSION}.tgz
wget --quiet http://apache.mirror.gtcomm.net/kafka/${KAFKA_VERSION}/kafka_2.10-${KAFKA_VERSION}.tgz -O ${KAFKA_INSTALL_ROOT}/kafka-${KAFKA_VERSION}.tgz
fi

for i in 1 2 3 4 5; do
Expand Down

0 comments on commit 950d619

Please sign in to comment.