== About ==
This is a request for deploying the change propagation service on SCB as part of the #EventBus project. The service will be used to track events emitted to the Kafka cluster and, according to the configured rules, will dispatch requests to various (internal) services. In the first iteration, RESTBase will be the only recipient (HTML changes, MobileApps ones, etc), but the plan is to eventually have other usages, like Varnish cache purging.
== Request Flow ==
Events are produced by MediaWiki and RESTBase; the former emits events to the Kafka cluster when new revisions are created, while the latter produces events when storage contents changes (HTML, MobileApps, summary, ...). These events are sent to the HTTP Proxy service, collocated with the Kafka cluster on `kafka100[12].eqiad.wmnet`. Once validated, they enter Kafka's pipeline and get consumed by the change propagation service. For each message matching one of the predefined rules a request is dispatched. Currently, all of the requests will be made to RESTBase. Based on the event, RESTBase may respond with new events that get enqueued in Kafka.
The most common workflow will be the following:
# An edit is made to a MW page
# MW emits the `revision_create` event
# The proxy service validates it and enqueues it in Kafka
# The change propagation serivce consumes it by sending a request to RESTBase to render the new version of the page
# Once the new render has been stored, RESTBase emits a new event signalling a new HTML render is available
# The change propagation service reacts to it by sending another request to RESTBase, this time asking for a re-render of the MobileApps response
# RESTBase requests the new version from MobileApps, stores it and emits a second event signalling the MobileApps content for the given title has changed
== Service Info ==
| **Owner** | @mobrovac / #services |
| **Contact person** | @mobrovac |
| **Timeline** | EoQ |
| **Source code** | [GitHub repo](https://github.com/wikimedia/change-propagation) |
=== See Also ===
- the #eventbus project
- {T114443}
- {T117933}