Giter Club home page Giter Club logo

atc-cosmos-eventstore's People

Contributors

atcbot avatar christianhelle avatar larsskovslund avatar noblix avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

atc-cosmos-eventstore's Issues

Adding custom JsonConverters to Client

Describe the bug
I have an issue where I have an event that contains a TimeOnly type which was added in .NET 6. Sadly .NET 6 does not come with build in JsonConverter for TimeOnly and DateOnly.

These are easily to implement as a custom JsonConverter however there are no way to add these converter to the Event Store.

A "workaround" is to add the converters to the TimeOnly/DateOnly properties in the event object through JsonConverterAttribute, like so:

[StreamEvent("event-name:v1")]
public record TimeEvent(
    [property: JsonConverter(typeof(JsonTimeOnlyConverter))]
    TimeOnly Time,

This works for simple cases but not if the I have more complex objects that contains TimeOnly further down. Then I would have to make custom converters for these types, only to be able to handle deserialization of a single properties within it.

My code could also end up with a lot of these attributes if a have a lot of different events requiring custom converters.

To Reproduce
Steps to reproduce the behavior:

  1. Create an event with a TimeOnly or DateOnly type
  2. Write the event to the event store
  3. An exception is thrown with the error System.NotSupportedException : Serialization and deserialization of 'System.DateOnly/TimeOnly' instances are not supported

Expected behavior
I am able to add custom JsonConverters to the Event Store client that are used when writing to, or reading from, the Event Store.

CosmosDb TransactionalBatch limitations

Persisting a large batch of events in a single command throws an exception that doesn't clearly explain why the operation failed

CosmosDb Transactional batch operation limitations
Currently, there are two known limits:

  • The Azure Cosmos DB request size limit constrains the size of the TransactionalBatch payload to not exceed 2 MB, and the maximum execution time is 5 seconds.
  • There's a current limit of 100 operations per TransactionalBatch to ensure the performance is as expected and within SLAs.

Expected behavior
Throw a more concrete error message in a specialized exception type would be the preferred way to describe why the operation failed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.