Akka Persistence + Deleting events + Tagging

21 views
Skip to first unread message

Her

unread,
Aug 21, 2017, 6:16:43 AM8/21/17
to Akka User List
Hi,

I really appreciate help on how to implement the following requirement:
- Delete all events in a journal belonging to a tenant (=legal requirement by our Customer)

Current configuration:
- Akka Persistence + Cassandra Plugin
- tag1 is set with DDD aggregate root type using a WriteEventAdapter (dynamic tagging)
- events have a field in the payload that identifies the tenant

I was thinking to implement this new requirement by setting tag2 with the tenantId. And when a tenant must be deleted delete all events where tag2 is set with the TentantId.
But setting tag2 with a dynamic tag is not possible because Tags that are attached to an event must be a Set[String] (see 1) and defined up front in a configuration file (see 2).

(1) case class Tagged(payload: Any, tags: Set[String]) { .. }
(2) Sample configuration of cassandra plugin
  # When using more than one tag per event you have to configure know
  # tags in this section to give each tag an identifier. When using
  # only one tag per event the identifier is 1, automatically.
  # tagname = tagid
  # where tagid must be 1, 2, or 3. Max 3 tags per event is supported.
  # For example:
  #   BlogPosts = 1
  #   Announcement = 2
  #   Authors = 1
  # With those tag identifiers you can use BlogPosts and Announcement for a single event,
  # but you cannot combine BlogPosts and Authors, since they have the same tag identifier.
  tags {
  }

For my requirement of having two dynamic tags just passing a Vector/List instead of defining Tags in a configuration file seems to be a better fit.
case class Tagged(payload: Any, tags: Vector[Option[String]])
val tags: Vector[Option[String]] = Vector(Some("ddd_aggr_root"), Some("tenant_id"))

Are there any plans to support dynamic tagging for more than one tag ?

Regards,
Her

Reply all
Reply to author
Forward
0 new messages