Skip to content

Commit

Permalink
docs: add event bus routing documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian2012 committed Feb 9, 2024
1 parent a58d05c commit d05324b
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
55 changes: 55 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,61 @@ An example configuration for ``AsyncRoutingBackend`` is provided below::
}


Event Bus Routing
-----------------

``event-tracking`` provides a solution for routing events to the Event Bus
using the ``EventBusBackend``. It extends ``RoutingBackend`` but sends events
to the Event Bus.

It can:

* Process event through the configured processors.
* If the event is allowed via `EVENT_BUS_TRACKING_LOGS`, send it to the Event Bus.

Make sure to enable the setting: ``SEND_TRACKING_EVENT_EMITTED_SIGNAL`` to allow the
``EventBusBackend`` to send events to the Event Bus.

An example configuration for ``EventBusBackend`` is provided below::

EVENT_TRACKING_BACKENDS = {
'xapi': {
'ENGINE': 'eventtracking.backends.event_bus.EventBusBackend',
'OPTIONS': {
'backend_name': 'xapi',
'processors': [
{
'ENGINE': 'eventtracking.processors.regex_filter.RegexFilter',
'OPTIONS':{
'filter_type': 'allowlist',
'regular_expressions': [
'edx.course.enrollment.activated',
'edx.course.enrollment.deactivated',
]
}
}
],
'backends': {
'xapi': {
'ENGINE': 'dummy.backend.engine',
'OPTIONS': {
...
}
}
},
},
},
'tracking_logs': {
...
}
...
}

EVENT_BUS_TRACKING_LOGS = [
'edx.course.enrollment.activated',
'edx.course.enrollment.deactivated',
]

Roadmap
-------

Expand Down
8 changes: 8 additions & 0 deletions doc/user_guide/api/eventtracking.backends.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,11 @@ eventtracking.backends.segment
:undoc-members:
:show-inheritance:


eventtracking.backends.event_bus
------------------------------

.. automodule:: eventtracking.backends.event_bus
:members:
:undoc-members:
:show-inheritance:

0 comments on commit d05324b

Please sign in to comment.