33 if ( !$this->config->has(
'KafkaEventHost' ) ) {
34 throw new InvalidArgumentException(
"KafkaEventHost must be configured" );
43 if ( !$this->producer ) {
44 $this->producer = Produce::getInstance(
45 null,
null, $this->config->get(
'KafkaEventHost' ) );
51 $jsonEvents = array_map(
'json_encode', $events );
54 $producer->setMessages( $channel, 0, $jsonEvents );
56 }
catch ( \Kafka\Exception
$e ) {
57 $this->logger->warning(
"Sending events failed: $e" );
Event relayer for Apache Kafka.
doNotify( $channel, array $events)
__construct(array $params)
Create Kafka producer.
getKafkaProducer()
Get the producer object from kafka-php.
Config $config
Configuration.
Produce $producer
Kafka producer.
Base class for reliable event relays.
A Config instance which stores all settings as a member variable.
returning false will NOT prevent logging $e
Interface for configuration instances.
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))