-
Notifications
You must be signed in to change notification settings - Fork 0
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
Support Resource Configuration #20
Conversation
src/main/scala/no/sysco/middleware/kafka/event/collector/cluster/BrokerManager.scala
Show resolved
Hide resolved
src/main/scala/no/sysco/middleware/kafka/event/collector/cluster/BrokerManager.scala
Show resolved
Hide resolved
src/main/scala/no/sysco/middleware/kafka/event/collector/cluster/BrokerManager.scala
Show resolved
Hide resolved
@@ -15,11 +15,14 @@ import scala.concurrent.duration._ | |||
|
|||
trait JsonSupport extends SprayJsonSupport with DefaultJsonProtocol { |
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.
Can be sealed
because uses only in this class
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.
I would rather recommend change name from JsonSupport
to smth else close to project naming convention (CollectorJsonProtocol
) to differ from Spray library.
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.
Agree
@@ -89,7 +96,7 @@ class TopicManager( | |||
*/ | |||
def handleTopicsCollected(topicsCollected: TopicsCollected): Unit = { | |||
log.info(s"Handling ${topicsCollected.names.size} topics collected.") |
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.
Change to log.info(s"Handling {} topics collected.", topicsCollected.names.size)
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.
Agree
src/main/scala/no/sysco/middleware/kafka/event/collector/cluster/BrokerManager.scala
Outdated
Show resolved
Hide resolved
var topicsAndDescription: Map[String, Option[TopicDescription]] = Map() | ||
var topics: Map[String, Option[Topic]] = Map() | ||
|
||
implicit val timeout: Timeout = 5 seconds |
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.
Could u add to javadoc info about timeout and why 5 secs? It is implicit value, so it used somewhere here in class (I guess its time out for Future
completion).
manager ! TopicEvent("topic-1", TopicEvent.Event.TopicCreated(TopicCreated())) | ||
manager ! TopicEvent("topic-2", TopicEvent.Event.TopicCreated(TopicCreated())) | ||
manager ! TopicEvent("topic-3", TopicEvent.Event.TopicCreated(TopicCreated())) | ||
|
||
// describe 2 internal |
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.
Dont forget also comments :) As I see now, U describe 2 NON-internal topic
manager ! TopicDescribed(("topic-2", TopicDescription(internal = true, List.empty))) | ||
manager ! TopicDescribed(("topic-2", TopicDescription(internal = false, List.empty))) | ||
eventRepositoryProbe.expectMsg(DescribeConfig(ResourceType.Topic, "topic-2")) | ||
eventRepositoryProbe.reply(Config()) | ||
eventProducerProbe.expectMsgType[TopicEvent] | ||
// describe 1 NOT internal |
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.
And opposite here U describe 1 INTERNAL topic
Entities like Topics and Brokers have additional configuration exposed via
AdminClient#describeConfigs
API.The goal of this PR is to add support for these configuration as part of the events collected.
This will break compatibility with version 0.1, then once merged a new release 0.2 will be started.