/** * Create Kafka producer. * * @param array $params */ public function __construct(array $params) { parent::__construct($params); $this->config = new HashConfig($params); if (!$this->config->has('KafkaEventHost')) { throw new InvalidArgumentException("KafkaEventHost must be configured"); } }
/** * Additional params include 'mcrdConfig', which is a map of: * - url : The base URL of the service (without paths) * @param array $params */ public function __construct(array $params) { parent::__construct($params); $this->baseUrl = $params['mcrdConfig']['url']; $httpConfig = isset($params['httpConfig']) ? $params['httpConfig'] : array(); if (!isset($httpConfig['connTimeout'])) { $httpConfig['connTimeout'] = 1; } if (!isset($httpConfig['reqTimeout'])) { $httpConfig['reqTimeout'] = 0.25; } $this->http = new MultiHttpClient($httpConfig); }