Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 08:53
    mysticmind converted_to_draft #1560
  • 08:53
    mysticmind converted_to_draft #1560
  • 08:51
    mysticmind commented #1568
  • 08:51
    mysticmind commented #1568
  • 08:35

    mysticmind on 3.13.2

    (compare)

  • 08:35

    mysticmind on 3.13.2

    (compare)

  • 08:28

    mysticmind on 3.13

    Bump up version to 3.13.2 for r… (compare)

  • 08:28

    mysticmind on 3.13

    Bump up version to 3.13.2 for r… (compare)

  • Oct 30 18:48
    oakio opened #79
  • Oct 30 16:48

    mysticmind on 3.13

    Allow null enum values to be pa… (compare)

  • Oct 30 16:48

    mysticmind on 3.13

    Allow null enum values to be pa… (compare)

  • Oct 30 15:31
    mysticmind commented #1585
  • Oct 30 15:31
    mysticmind commented #1585
  • Oct 30 15:31

    mysticmind on master

    Allow null enum values to be pa… (compare)

  • Oct 30 15:31

    mysticmind on master

    Allow null enum values to be pa… (compare)

  • Oct 30 15:31
    mysticmind closed #1585
  • Oct 30 15:31
    mysticmind closed #1585
  • Oct 30 14:58
    jeremydmiller closed #1364
  • Oct 30 14:58
    jeremydmiller closed #1364
  • Oct 30 14:58
    jeremydmiller commented #1364
Oskar Dudycz
@oskardudycz
there are also few other samples there
Nico Sap
@NicoJuicy
I just cloned the repo, exploring it now :p
Nico Sap
@NicoJuicy
Thanks! ( i was already planning to check it all fyi ;) )
Oskar Dudycz
@oskardudycz
Plus self-paced kit of how to build even store on Postgres
Or I should say - understand on a smaller scale how Marten works ;)
Nico Sap
@NicoJuicy
image.png
It references a folder in Sample / tickets
while the Core and Core.Testing libraries are in the root
Oskar Dudycz
@oskardudycz
Ah, good, I need to fix that ;)
Nico Sap
@NicoJuicy
i'm willing to send a PR though, move the core libraries to the sample folder or reference them to the root?
Oskar Dudycz
@oskardudycz
use the main solution
Referencing root will be fine. I did a lot of cleanups to reorganise all sample
Nico Sap
@NicoJuicy
No need to explain
I'm just opening everything and digging in ;
;)
Oskar Dudycz
@oskardudycz
And I forgot about this solution - I use that presentation for the ”Practical Event Sourcing with Marten” webinar
I’d be happy to take PR with a fix for that :)
Nico Sap
@NicoJuicy
oskardudycz/EventSourcing.NetCore#31 - submitted - checks passed
Oskar Dudycz
@oskardudycz
Thank you! Approved and merged ❤️
Nico Sap
@NicoJuicy
Hurray
Thah
Nico Sap
@NicoJuicy
@oskardudycz Why kafka and not something like nats ( streaming) ? - just a question
Oskar Dudycz
@oskardudycz
I used Kafka in my projects, so it was mostly based on my experience. Plus I’m quite often asked on workshops about Kafka - it’s useful for explaining the streaming concepts like logical split (topics) and physical (partitions)
I’ve read good things about nats, but I haven't played with it yet
If I have time, I’ll probably provide some samples on it or Rabbit
Nico Sap
@NicoJuicy
I have not much experience with saga's though and your implementation is very clean. Am i correct that your implementation ( OrderSage ) wouldn't be good enough for a time based trigger? ( eg. after ordering they have 15 minutes to cancel and then the order goes through).
I'm not actually sure what is different with the OrderSaga in comparision to eg. the CartEventHandler. Both could be a combination of event handlers ( i expected some sort of state machine )
But i'm really impressed with the quality and simplicity of your code (y)
As Borat would say: very nice @oskardudycz
Small anekdote would be using enumerations instead of actual enums ( since i noticed you use ValueObjects)
Nico Sap
@NicoJuicy
( ( i expected some sort of state machine and a correlationId actually)
Bart Timmermans
@bartimer
I'm trying to use the v4.0 alpha version in combination with HotChocolate graphql fitering which does an out of the box translation to an IQueryable. One of the use cases is a filter on the product name of an orderline in an order (order -> orderlines[] where orderline -> product -> name). This results in an ArgumentOutOfRangeException("No members found in this Expression (Parameter 'members')") at Marten.Linq.Fields.FieldMapping.resolveField(MemberInfo[] members) in C:\code\marten\src\Marten\Linq\Fields\FieldCollection.cs:line 106.
This is because it's an expression and not a field. I can reproduce it with the unit test in Marten.Testing.Linq.ChildCollections.count_for_child_collections ```public void GivenTwoLevelsOfChildCollections_WhenCountCalled_ThenReturnsProperCount()
{
StoreOptions(op => op.UseDefaultSerialization(collectionStorage: CollectionStorage.AsArray));
        SetupTestData();

        theSession.Logger = new TestOutputMartenLogger(_output);

        var result = theSession
            .Query<Root>()
            .Where(r => r.ChildsLevel1.Any(c1 => c1.Name == "child-1.1"))
            .Select(x=>  new {x.Name,Lines = x.ChildsLevel1.Select(y => new {y.Name})})
            .ToList();

        result.ShouldHaveSingleItem();
    }``` where I added a select. Is this something that you plan to support? And thank you very much for this awesome project!
Jeremy D. Miller
@jeremydmiller
@bartimer I’ve never considered the Select() within a Select() in the Linq Expression. You gotta remember that every single thing like that in the Linq Expression parsing has to be explicitly coded upfront.
Interesting thought that you’re combining GraphQL w/ Marten. I’ve never thought that what you’re trying to do in creating the Select() on the fly was going work well with Marten. Or to be more accurate, I’ve always thought that Marten probably wouldn’t play nice with GraphQL unless you accepted that Marten was going to overfetch data
I think with GraphQL you’d be better off skipping the Linq parsing and building something in parallel that parsed the GraphQL query and write directly to the Postgresql JSON operator syntax.
Which might also be easier w/ Postgresql v12 & above w/ it’s sql/json support. I think trying to use Linq in between Graph QL is gonna be slow and complicated.
Oskar Dudycz
@oskardudycz
@bartimer I have a plan to also play with HotChocolate, however, I'm not sure if we'll support partial select soon.
Currently even if you're doing Select then it still loads whole document but just returning the selected fields.
Oskar Dudycz
@oskardudycz
@NicoJuicy Thank you a lot for good words. I was trying to provide that as simple as possible. Of course if the example was more advance then for sure more code compromises would appear.
Regarding saga - in my opinion it should be such simple. It should just handle events and base on them (and ONLY on them) should be sending command. This is different from the process managers where they're stateful. So they're state machines. From my experience keeping Saga dummy, makes it easier to maintain and more scalable. It's also easier to migrate processes "in progress". Of course for some category of cases, Process Managers will be good option. I did a "trick" that some commands are send and handled by Order aggregate and that allows to publish events that contain more data than events. Eg. payment event shouldn't know all details of Product and shipment doesn't need prices etc. Thanks to that you're splitting the process into series of "micro-transactions". And Saga is just coordinator, not the manager.
Regarding the saga termination - you're 100% right - you can have background process that will just publish the event after 15m and Saga will start compensation operations.
Regarding CartEventHandler it's also used to show how to translate the internal events (CartConfirmed) that are more granular into External (Domain) events. Those events are interesting for other modules. Eg. they don't care about a tentative shopping cart, so they shouldn't be listening for all possible events because that would be leaky business logic. I had that in my previous project and it ended up with distributed monolith...
Oskar Dudycz
@oskardudycz
If you're looking for Stateful saga then you an have a look at @jeremydmiller Jasper implementation http://jasperfx.github.io/documentation/execution/sagas/
Bart Timmermans
@bartimer
@oskardudycz @jeremydmiller Thx for the feedback. For the current project i'm working on, it would not be a big issue to overfetch from the db. In the previous version 3.13.1 of Marten this Select() within the Select() seems to work but it doesn't have the filtering capabilities of the v4 . I understand your point about building something in parallel but I guess that is gonna be quite a task to write such a provider for HotChocolate :). @oskardudycz , I've you plan to use HotChocolate in combination with Marten, I'm interested to hear your thoughts/opinions about it.
Babu Annamalai
@mysticmind
@jeremydmiller @oskardudycz Quick note, I am planning to do a bug fix release of 3.13.2 by tomorrow which addresses 3 issues.
Thumann
@Thumann

Hi, In RavenDb there are Map Indexes, can i do something similar with Marten?
My entity has a collection of child objects, each with a serialnumber property. I'd like to be able to index this(these) value.
Like, do something like: x.Schema.For<DsoRelationship>().Duplicate(c => c.Meters.Select(c=> c.SerialNumber).ToArray(), pgType: "text[]", dbType: NpgsqlTypes.NpgsqlDbType.Array);

Without an index, when I do a search like the following:
session.Query<DsoRelationship>().Where(c => c.Meters.Any(o => o.SerialNumber == serialNumber)), takes around a second to finish with ~350.000 documents.
In Raven with a map index it takes around ~50ms.

Babu Annamalai
@mysticmind
@Thumann you can create separate getter property SerialNumbers to surface the SerialNumber values from Meters and then use the same as a duplicate field. See some case samples below for your reference:
class DsoRelationship
        {
            public int Id { get; set; }
            public DsoRelationship()
            {
                Meters = new List<Meter>();
            }

           // adding json ignore to not store in the serialized document but for the duplicate field
            [JsonIgnore]
            public List<int> SerialNumbers {
                get
                {
                    return Meters.Select(x => x.SerialNumber).ToList();
                }
            }
            public List<Meter> Meters { get; set; }
        }
_.Schema.For<DsoRelationship>().Duplicate(x => x.SerialNumbers, "int[]");
Babu Annamalai
@mysticmind
@/all Bug fix release 3.13.2 available in NuGet. You can check the release notes here
Oskar Dudycz
@oskardudycz
Thank you Babu :+1: