openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markusthoem...@apache.org
Subject [incubator-openwhisk] branch master updated: Fixes EntitlementProvider to use SpiLoader (#3786)
Date Wed, 20 Jun 2018 21:18:47 GMT
This is an automated email from the ASF dual-hosted git repository.

markusthoemmes pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
     new 09d9a91  Fixes EntitlementProvider to use SpiLoader (#3786)
09d9a91 is described below

commit 09d9a9153239d1f8f9fe3748adab9f4107b73042
Author: Pavel Kravchenko <kpavel@il.ibm.com>
AuthorDate: Thu Jun 21 00:18:43 2018 +0300

    Fixes EntitlementProvider to use SpiLoader (#3786)
    
    to get MessagingProvider instead of using hardcoded KafkaMessagingProvider
---
 .../src/main/scala/whisk/core/entitlement/Entitlement.scala         | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/core/controller/src/main/scala/whisk/core/entitlement/Entitlement.scala b/core/controller/src/main/scala/whisk/core/entitlement/Entitlement.scala
index eaf08e9..23007f3 100644
--- a/core/controller/src/main/scala/whisk/core/entitlement/Entitlement.scala
+++ b/core/controller/src/main/scala/whisk/core/entitlement/Entitlement.scala
@@ -28,7 +28,6 @@ import akka.http.scaladsl.model.StatusCodes.TooManyRequests
 import whisk.core.entitlement.Privilege.ACTIVATE
 import whisk.core.entitlement.Privilege.REJECT
 import whisk.common.{Logging, TransactionId, UserEvents}
-import whisk.connector.kafka.KafkaMessagingProvider
 import whisk.core.WhiskConfig
 import whisk.core.connector.{EventMessage, Metric}
 import whisk.core.controller.RejectRequest
@@ -37,6 +36,8 @@ import whisk.core.loadBalancer.{LoadBalancer, ShardingContainerPoolBalancer}
 import whisk.http.ErrorResponse
 import whisk.http.Messages
 import whisk.http.Messages._
+import whisk.core.connector.MessagingProvider
+import whisk.spi.SpiLoader
 
 package object types {
   type Entitlements = TrieMap[(Subject, String), Set[Privilege]]
@@ -143,7 +144,8 @@ protected[core] abstract class EntitlementProvider(
       activationThrottleCalculator(config.actionInvokeConcurrentLimit.toInt, _.limits.concurrentInvocations),
       config.actionInvokeSystemOverloadLimit.toInt)
 
-  private val eventProducer = KafkaMessagingProvider.getProducer(this.config)
+  private val messagingProvider = SpiLoader.get[MessagingProvider]
+  private val eventProducer = messagingProvider.getProducer(this.config)
 
   /**
    * Grants a subject the right to access a resources.


Mime
View raw message