markusthoemmes commented on a change in pull request #2228: Hook up reactive 
pool into invoker startup
URL: 
https://github.com/apache/incubator-openwhisk/pull/2228#discussion_r116379652
 
 

 ##########
 File path: core/invoker/src/main/scala/whisk/core/invoker/Invoker.scala
 ##########
 @@ -442,12 +443,25 @@ object Invoker {
             val groupid = "invokers"
             val maxdepth = ContainerPool.getDefaultMaxActive(config)
             val consumer = new KafkaConsumerConnector(config.kafkaHost, 
groupid, topic, maxdepth)
+            val producer = new KafkaProducerConnector(config.kafkaHost, ec)
             val dispatcher = new Dispatcher(consumer, 500 milliseconds, 2 * 
maxdepth, actorSystem)
 
-            val invoker = new Invoker(config, instance, 
dispatcher.activationFeed)
+            val invoker = if 
(Try(config.invokerUseReactivePool.toBoolean).getOrElse(false)) {
+                new InvokerReactive(config, instance, 
dispatcher.activationFeed, producer)
+            } else {
+                new Invoker(config, instance, dispatcher.activationFeed, 
producer)
+            }
+            logger.info(this, s"using $invoker")
+
             dispatcher.addHandler(invoker, true)
             dispatcher.start()
 
+            Scheduler.scheduleWaitAtMost(1.seconds)(() => {
+                producer.send("health", 
PingMessage(s"invoker$instance")).andThen {
 
 Review comment:
   Note, that `Invoker.scala` also includes the `main` method, hence a couple 
of changes in that file which seem "strange". The producer is part of the main 
method and thus is valid for both Invokers.
 
----------------------------------------------------------------
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

Reply via email to