dgrove-oss commented on a change in pull request #2948: Programmatic lazy
creation of completedN and invokerN topics
URL:
https://github.com/apache/incubator-openwhisk/pull/2948#discussion_r150961265
##########
File path: core/invoker/src/main/scala/whisk/core/invoker/Invoker.scala
##########
@@ -182,6 +187,17 @@ object Invoker {
val invokerInstance = InstanceId(assignedInvokerId)
val msgProvider = SpiLoader.get[MessagingProvider]
+ if (!msgProvider.ensureTopic(
Review comment:
The keys of the Map are pretty kafka specific. The values are both kafka
specific and specific to the topic being created (see similar block in the
controller where we read different fields of WhiskConfig).
I think using a Map[String,String] is probably workable in a generic SPI,
but when populating the map you end up needing to know the SPI implementation
you are talking to.
An alternative would be to not pass a Map and instead pass just the config
object and the topic name. We could look at the topic prefix inside the
ensureTopic implementation of the kafka messaging provider and use it to figure
out which fields of the config to extract.
I think this really doesn't help make it more generic, since the details of
the messaging provider are still being leaked into the WhiskConfig. I could
make the change though without much effort.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services