Skip to content

Conversation

@kalondar
Copy link
Contributor

@kalondar kalondar commented Mar 1, 2017

Hi

We need to test message flow with messages bigger than default 1MB.
I've prepared a pull request with additional custom producer and consumer configurations.
I also created a unit test for it and updated README with code example.
Can you take a look ?
Any comments welcome

In near future, I plan to merge it to 0.8 branch, because we need it on Spark 1.6

Regards

import scala.language.postfixOps

class EmbeddedKafkaCustomConfigSpec extends EmbeddedKafkaSpecSupport with EmbeddedKafka {
val TWO_MEGABYTES = 2097152
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these should be probably be named TwoMegabytes and ThreeMegabytes as per http://docs.scala-lang.org/style/naming-conventions.html

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point

val THREE_MEGABYTES = 3145728

"the custom config" should {
"should allow pass additional producer parameters" in {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should is redundant here :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ehhh, yes :)

}

def generateMessageOfLength(length: Int): String = Stream.continually(util.Random.nextPrintableChar) take length mkString
} No newline at end of file
Copy link
Owner

@manub manub Mar 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline please (at the end of file)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link
Owner

@manub manub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the effort! Please fix a couple of minor style issues and then I'll merge it.

@kalondar
Copy link
Contributor Author

kalondar commented Mar 1, 2017

Fixed

@manub manub merged commit 7c91709 into manub:master Mar 1, 2017
@manub
Copy link
Owner

manub commented Mar 1, 2017

Thanks! You were mentioning you need this on 0.8 branch?

@kalondar
Copy link
Contributor Author

kalondar commented Mar 1, 2017

Sorry, I made a mistake. I thought about Kafka 0.9, but no branch here

@kalondar kalondar deleted the custom_configuration branch March 1, 2017 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants