-
Notifications
You must be signed in to change notification settings - Fork 83
Added a way to create topics and brokers by passing a custom configuration #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -239,4 +242,12 @@ sealed trait EmbeddedKafkaSupport { | |||
broker.startup() | |||
broker | |||
} | |||
|
|||
def createCustomTopic(topic: String, topicConfig: Properties)(implicit config: EmbeddedKafkaConfig): Unit = { | |||
val zkSessionTimeoutMs = 10000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this and following val
s should be pulled out of this method, at the trait level, in order to avoid instantation every time the method gets called
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I've moved them at the trait level as suggested.
LGTM, just a minor comment. |
…n when whe create custom topics
Thanks - I'll be doing a release by the end of the week, 0.5.1. |
@lucapertile actually it slipped out of my mind that we don't have scaladoc nor readme for this. Could you please create another PR before releasing? |
@@ -239,4 +246,8 @@ sealed trait EmbeddedKafkaSupport { | |||
broker.startup() | |||
broker | |||
} | |||
|
|||
def createCustomTopic(topic: String, topicConfig: Properties)(implicit config: EmbeddedKafkaConfig): Unit = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working with Properties in Scala is a bit ugly, have you considered using a Map[String, String
] for the interface of this function instead ?
Cleaned up the formatting noise and implemented the suggested changes. This PR adds support for custom topic and broker creation by enabling clients to pass a custom config when they create a broker or a topic.