Link events in projections

Hey

Is there any way to get the data from the linkTo event in a projection that is processing these events? All I can see in the debugger is the original event (data + metadata). Even if I explicitly specify metadata in linkTo call this information is not available in a downstream projection. I need this kind of info to decide where to link the events in the next stage of processing.

Szymon

As of now no but this would be relatively easy to change.

I would be more than happy to do it if you can tell me a bit how you would like this to be done (i.e. how would you like the link metadata to be exposed)

Szymon

Seems like I would have to change whole path from TransactionFileEventReader’s DeliverEvent() up to V8ProjectionStateHandler by adding link information to CommittedEventDistributed and CommittedEventReceived messages. I think adding only the metadata (as byte[]) should be enough. Then I would expose it as ‘linkMetadata’ property on the envelope. Sounds OK?

Szymon

We talked about this.

So I think it should be an option (in options) and off by default for both the link event and metadata being added. The reason being is that the object creations can be expensive if you don’t need them.

Greg

Szymon,

I’m making changes to enable event re-categorization (special kind of linkTo). I’ll include linkToMetadata on event envelope passed to a projection as well.

-yuriy

Yuriy

Cool. Please ping me when you commit that to develop so I can start experimenting

Szymon

Szymon,

I pushed changes to the projections branch. Original link metadata are
available as .linkMetadata property on the event object passed into a
projection.

You need to rebuild js1.dll as well, if you try the projections branch.
I'm not sure how stable the branch is right now, however.

-yuriy

Do you think it would be possible to merge this one commit to dev? I’ll try and see how many things break

It changes few lines of code I’ve already touched. So, a little manual merging is required. I’ll port to dev and rebase projections branch today/tomorrow.

-yuriy

Szymon,

It is not so easy to separate changes.

I don’t any major problems in ‘projections’ branch right now. I’ve created a new tag projections-linkMetadata. Let me know if it works for you.

-yuriy