How to persistently subscribe to aggregate streams when stream name is "dynamic"?

My event sourced aggregate publish events to a stream that has this name template: [tenantId]-[aggregateTypeName]-[aggregateId].

How can my consumer (that updates a read model/view) persistently subscribe to these events when it does not know the entire stream name? It knows only the [aggregateTypeName] part.

  1. Wouldn’t it be a solution to have stream name (on CQRS Writer side) like [aggregateTypeName]-[aggregateId]-[tenantId] ?
    Then Reader may listen to $by_category projection “$ce-[aggregateTypeName]” - it would receive all events of aggregates of that type.
  2. Shouldn’t ‘tenantId’ be a part of Event (and not mentioned in stream name)?

We are starting some CQRS+Event sourcing based project and do not have much experience yet, so I’m not an “expert” in any of ways.
If You (or anyone reading this) see any disadvantages of such a solution - let me know why.

This would work.

Thanks, that seemed to work fine!