Users and API clients wish to be alerted whenever some data is added/modified/deleted from GG-CE. User alerts may be issued in form of emails (or in-app notifications), while API clients may want to receive a ping on the URL of their choice.
The initial implementation of the Firehose in GG-CE listens to save/delete operations on all JPA repositories, maintains an internal list of "fired" operations by Entity
type + its resulting
id and only triggers a message after the specified delay. The delay prevents:
- notifications in case the entity is added and quickly removed.
- multiple notifications in case of several quick updates to the same record.
- multiple update + 1 delete notification if the record is added but quickly removed.
The Firehose delay is configurable and it defaults to 5 minutes. This is usually sufficient for the author to spot any errors and do updates.
If there is no change to a record in the queue for the specified delay time, a Firehose message is released/triggered. The message contains the
lazyLoaded version of the entity in question. In case of deletes, only the entity
id are provided.
Add a new
FirehoseJPAProcessor that captures and manages the messages, and a
FirehoseMessageProcessor that receives notifications from the
FirehoseJPAProcessor and logs them to the system log.