sven-lange-last commented on a change in pull request #3912: Fix
max.poll.interval.ms setting of KafkaConsumer.
URL:
https://github.com/apache/incubator-openwhisk/pull/3912#discussion_r206094547
##########
File path:
common/scala/src/main/scala/whisk/connector/kafka/KafkaMessagingProvider.scala
##########
@@ -101,4 +101,24 @@ object KafkaConfiguration {
def configMapToKafkaConfig(configMap: Map[String, String]): Map[String,
String] = configMap.map {
case (key, value) => configToKafkaKey(key) -> value
}
+
+ /**
+ * Prints a warning for each unknown configuration item and returns false if
at least one item is unknown.
+ *
+ * @param config the config to be checked
+ * @param validKeys known valid keys to configure
+ * @return true if all configuration keys are known, false if at least one
is unknown
+ */
+ def verifyConfig(config: Map[String, String], validKeys:
Set[String])(implicit logging: Logging): Boolean = {
+ val passedKeys = config.keySet
+ val knownKeys = validKeys intersect passedKeys
+ val unknownSettings = config -- knownKeys
+
+ if (unknownSettings.nonEmpty) {
+ logging.warn(this, s"potential misconfiguration, unknown settings:
${unknownSettings.mkString(",")}")
Review comment:
Sounds reasonable.
----------------------------------------------------------------
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