So whilst trying track down a bug where not all events are making into my denormalized store, I came across this issue. Basically, the even data appears to be wrong:
This is what is being logged by my logger:
Could not deserialize event { EventType: “$>”, EventData: “0@Review-c684dfc0-c33e-830a-78ac-512702b4d410” }
This is how I’m logging it:
var asJson = Encoding.UTF8.GetString(resolvedEvent.Event.Data);
Logger.Error(“Could not deserialize event {@Event}”, this, new
{
resolvedEvent.Event.EventType,
EventData = asJson
});
``
where resolved event is the instance of EventStore.ClientAPI.ResolvedEvent
being handed back to me by the Catchup subscription. This doesn’t look right to me and would explain why the deserialization failures.
When I look up this event in EventStore, nothing looks wrong to me
Data
{
"$type": "DAS.Services.Reviews.Messaging.EventStore.V1.Review.ReviewCreated, DAS.Services.Reviews.Messaging",
"ClientId": "07468652-b8f0-dc0e-fae2-7c70efb51c2b",
"ReviewSource": "Vendasta",
"ReviewSite": "Facebook",
"RatedComment": {
"$type": "DAS.Services.Reviews.Messaging.EventStore.V1.Review.RatedCommentEventInfo, DAS.Services.Reviews.Messaging",
"Rating": 4.0,
"ParentReviewId": "00000000-0000-0000-0000-000000000000",
"SourceReviewId": "RVW-EC1A5DB3CBAB4679A7F9418BDD4762D4",
"CalculatedId": "c684dfc0-c33e-830a-78ac-512702b4d410",
"Labels": {
"$type": "System.String[], mscorlib",
"$values": []
},
"Author": "Bradley Gaarder",
"Content": "",
"CommentDate": "2016-01-06T21:37:41+00:00",
"Comments": {
"$type": "DAS.Services.Reviews.Messaging.EventStore.V1.Review.CommentEventInfo[], DAS.Services.Reviews.Messaging",
"$values": []
}
},
"EventType": "ReviewCreated",
"Metadata": {
"$type": "DAS.Infrastructure.Practices.EventSourcing.EventMetadata, DAS.Infrastructure.Practices",
"AssemblyQualifiedType": "DAS.Services.Reviews.Messaging.EventStore.V1.Review.ReviewCreated, DAS.Services.Reviews.Messaging, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null",
"EventNamespaces": "DAS.Services.Reviews.Review.ReviewCreated.V1"
},
"EntityId": "c684dfc0-c33e-830a-78ac-512702b4d410",
"EventId": "020d6256-3c1a-4eeb-ab6f-fcdaaf0a9cc3",
"Version": 0,
"Reason": null
}
Metadata
{
"$type": "DAS.Infrastructure.Practices.EventSourcing.EventMetadata, DAS.Infrastructure.Practices",
"AssemblyQualifiedType": "DAS.Services.Reviews.Messaging.EventStore.V1.Review.ReviewCreated, DAS.Services.Reviews.Messaging, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null",
"EventNamespaces": "DAS.Services.Reviews.Review.ReviewCreated.V1"
}
Any ideas?