$by_correlation_id projection

Hi,

I tried to test $by_correlation_id projection, but no $bc streams are available while projection enabled.

I enabled the projection and emitted some events with “$correlationId”: “332d7902-f9ca-4565-a069-2002b55ffc44”, but the stream “$bc-332d7902-f9ca-4565-a069-2002b55ffc44” doesnt exists. In projection detail is right number of processed events, but the projection doesnt create any new streams.

Am I doing something wrong?

Thanks,

Jakub Koci

Hi,

Is this on ES 5 or 4? Did you put the field in the event or the
metadata? (needs to be in metadata AFAICT)

/Rickard

Hi,

yes it is on Event Store 5.0.0.0, running in docker. I have correlationId in metadata with same key like in the projection:

{"$correlationId": “332d7902-f9ca-4565-a069-2002b55ffc44” }

{“correlationIdProperty”:"$correlationId"}

When I emit new event the processed events number in projection is increased so everything looks working, but no “$bc-” stream appear.

Thanks

út 26. 2. 2019 v 11:19 odesílatel Rickard Öberg [email protected] napsal:

So, just to double check:
In config you have:
RunProjections: System

You have enabled the projection:
curl -i -X POST
"http://localhost:2113/projection/%24by_correlation_id/command/enable"
-H "accept:application/json" -H "Content-Length:0" -u admin:changeit

You can see it running at:
http://localhost:2113/web/index.html#/projections

But it doesn't show up at:
http://localhost:2113/web/index.html#/streams

Is that correct?

/Rickard

Correct. Im running also $by_category projection and it works without any problems…

út 26. 2. 2019 v 15:13 odesílatel Rickard Öberg [email protected] napsal:

I found the problem…

I am using ES HTTP API client, which sends body with escaped quotes in data and metadata. So the projection can not propably identify correlationIdProperty:

[

{

“eventId”: “someId”,

“eventType”: “someType”,

“data”: “{“aggragateId”:“95799ea1-aab1-4b20-aadc-d7cfff6fd4c3”}”,

“metadata”: “{”$correlationId":“fbacdd2b-88a3-4b5f-995b-131ff187f660”}"

}

]

If I send it like standart json, projection works right:

[

{

“eventId”: “someId”,

“eventType”: “someType”,

“data”: {“aggragateId”:“95799ea1-aab1-4b20-aadc-d7cfff6fd4c3”},

“metadata”: {"$correlationId":“fbacdd2b-88a3-4b5f-995b-131ff187f660”}

}

]

ES accept both formats and events are identical in the ES, but the first format its not processed by $bc projection, which is little bit confusing.

út 26. 2. 2019 v 15:20 odesílatel Jakub Koci [email protected] napsal:

Hey folks,

Sorry for the dumb question, but how can you see the Visualisation of the correlationId using public Docker image?
Do I need to get “Enterprise” for that or is the Enterprise for production only (not sure how the licensing works)?

Cheers,
D.

Hey there,

Yup, it’s just for commercial users I’m afraid.

Chris

Thanks Chris.

Maybe you know if there is some documentation on this publicly available
(can't seem to see it, and event change-log screenshot is a 404)?

You can find a little here - ​https://github.com/EventStore/documentation/pull/333

But it’s not finished, and I’m not sure useful it is to you without having the featue.

Chris