New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include metadata on options for projections #2960
Comments
I actually have a proof of concept working for this, but a littler nervous on some of the changes for this. Projections.js I included a metadata property on options; ProjectionNamesBuilder.cs _sources.Metadata added ProjectionSourceDefination.cs
and set Metadata when constructing QuerySourceOptions ResultEventEmitter.cs _resultStreamMetadata is no longer readonly Inside CreateResultUpdatedEvents I am doing this:
SourceDefinitionBuilder.cs
|
It seems to be working, and I have tried it on projections with partitions. If there are no major problems with this, I am happy enough to implement this. |
Thanks for the suggestion @StevenBlair123, we're discussing this internally Just to clarify, this issue is only for setting metadata on result streams created by the projections, not for emitted stream. Is that correct? |
@hayley-jean - yeah exactly. |
Thanks! We're discussing this feature internally and will let you know what we decide |
Did you make any decision on this? |
Hi @StevenBlair123, we haven't made a decision on this yet. It's also worth noting that if we do decide to add it, it'll likely only be added to the interpreted runtime rather than the V8 one |
I think this is really important otherwise theres a huge gap missing. I was shocked to see this feature was missing as it is a common use case. |
I know it might sound a bit harsh, but in reality we haven't heard people complaining about it before. Apparently, it's useful, but it's not shocking that we don't have it, and it maybe is not as common use case as one might think. We will triage the issue shortly and post an update here. |
Is your feature request related to a problem? Please describe.
When you create a new projection, it is currently not possible to set metadata for result stream.
One example when this could be very useful is streams where you want to set maxAge / maxCount for streams where holding the last few events is desirable.
An example we have in production is stock level values for Products.
We have 1000's of events per product, which are no longer needed after a certain time.
These streams are created via a projection, so we have no way of easily setting the maxCount / maxAge on each stream.
Describe the solution you'd like
When using options on a Projections, be able to include metadata fields for maxAge and maxCount like this:
options({
resultStreamName: "my_demo_projection_result",
metadata : "{ "maxAge": 2592000, "maxCount" : 2 }"
})
Describe alternatives you've considered
We can build some software to listen for streams being created, then set the metadata that way, or alternatively, write out events into a "bucket" stream, then just manually set maxAge.
Additional context
Add any other context or screenshots about the feature request here.
DB-455
The text was updated successfully, but these errors were encountered: