Page MenuHomePhabricator

EventBus mediawiki extension should support multiple 'event service' endpoints
Closed, ResolvedPublic5 Estimated Story Points

Description

In order to support both the eventlogging-service-eventbus, as well as multiple eventgate services, the EventBus mediawiki extension needs modified to support multiple endpoints. eventbus service and eventgate have the same HTTP API (although the format of the events they accept is slightly different), so the EventBus extension can be used as is, with either, as long as it is pointed at the correct endpoint.

I plan on modifying the existing single endpoint configs EventServiceUrl and EventServiceTimeout, to a single EventServices hash config.

Example:

$wgEventServices = [
    'eventbus' => [
        'url' => 'http://eventbus.discovery.wmnet:8085/v1/events',
        'timeout' => 30,
    ],
    'eventgate-analytics' => [
       'url' => 'http://eventgate-analytics.discovery.wmnet:30192/v1/events',
    ],
    'eventgate-main' => [
        'url' => 'http://eventgate-main.discovery.wmnet:30192/v1/events',
    ]


];

This will deprecated the global EventServiceUrl config, in favor of the hash. EventBus::getInstance will remain backwards compatible with EventServiceUrl. The new behavior will expect that pass in the name of the event service endpoint you want when you ask for an EventBus instance, e.g.

$eventbusService = EventBus::getInstance('eventbus');
// or
$eventgateAnalyticsService = EventBus::getInstance('eventgate-main');
// etc.

This way individual hooks can choose which service endpointm to send an event to.

Event Timeline

Ottomata triaged this task as Medium priority.Jan 22 2019, 11:02 PM
Ottomata created this task.

Change 485969 had a related patch set uploaded (by Ottomata; owner: Ottomata):
[mediawiki/extensions/EventBus@master] [WIP] Support multiple event service endpoints

https://gerrit.wikimedia.org/r/485969

Order of operations:

  • T215834: EventBusRCFeedEngine should use FormattedRCFeed instead of RCFeedEngine to use updated configuration
    • Deploy backwards compatible rcfeed mediawiki-config change
    • Deploy code change
    • Remove unused rcfeed mediawiki-configs
  • Backwards compatible EventBus config change to support multiple endpoints
    • mediawiki-config change to configure multiple endpoints
  • EventBusRCFeedEngine code change to use EventBus multiple endpoint configs (via $wgEventServices)
    • deploy mediawiki-config change to update EventBusRCFeedEngine (set class param for $eventServiceName)
  • Remove any deprecated and unused config code in EventBus

Change 485969 merged by Ottomata:
[mediawiki/extensions/EventBus@master] Support multiple event service endpoints

https://gerrit.wikimedia.org/r/485969

Change 490418 had a related patch set uploaded (by Ottomata; owner: Ottomata):
[operations/mediawiki-config@master] Add EventBus multi endpoint configuration and add eventgate-analytics endpoint

https://gerrit.wikimedia.org/r/490418

Ottomata raised the priority of this task from Medium to High.Feb 21 2019, 5:53 PM

Change 492023 had a related patch set uploaded (by Ottomata; owner: Ottomata):
[mediawiki/extensions/EventBus@master] Remove support of wgEventServiceUrl in favor of multi instance wgEventServices

https://gerrit.wikimedia.org/r/492023

Change 490418 merged by Ottomata:
[operations/mediawiki-config@master] Use EventBus multi endpoint configuration for eventbus configs

https://gerrit.wikimedia.org/r/490418

Change 492023 merged by Ottomata:
[mediawiki/extensions/EventBus@master] Remove support of wgEventServiceUrl in favor of multi instance wgEventServices

https://gerrit.wikimedia.org/r/492023