Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 08 19:04
    gfoidl closed #2410
  • Dec 08 19:04
    gfoidl closed #2410
  • Dec 08 19:04
    gfoidl commented #2410
  • Dec 08 19:04
    gfoidl commented #2410
  • Dec 08 18:55
    natalie-o-perret commented #1283
  • Dec 08 18:55
    natalie-o-perret commented #1283
  • Dec 08 14:46
    dependabot[bot] labeled #757
  • Dec 08 14:46
    dependabot[bot] labeled #757
  • Dec 08 14:46

    dependabot[bot] on nuget

    Bump Newtonsoft.Json from 13.0.… (compare)

  • Dec 08 14:46
    dependabot[bot] opened #757
  • Dec 08 12:22
    lamelyan edited #2421
  • Dec 08 12:22
    lamelyan edited #2421
  • Dec 08 12:18
    lamelyan edited #2421
  • Dec 08 12:18
    lamelyan edited #2421
  • Dec 08 12:18
    lamelyan edited #2421
  • Dec 08 12:18
    lamelyan edited #2421
  • Dec 08 12:14
    lamelyan edited #2421
  • Dec 08 12:14
    lamelyan edited #2421
  • Dec 08 12:13
    lamelyan edited #2421
  • Dec 08 12:13
    lamelyan edited #2421
Babu Annamalai
@mysticmind
I attempted to search partial text search in the search box and it did not list the section on ngram index. So looks to be an issue with the Algolia search indexing, will take a look.
Shawn de Wet
@shawndewet_twitter
@mysticmind I did see that article, and implemented that approach, which resulted in the response taking 6s as indicated in my original post on this topic. Implementing the .NgramIndex(x=> x.Description) as mentioned by @apereriratl resulted in the response taking 6ms. This was, however, undocumented (or I missed the documentation on it).
1 reply
Babu Annamalai
@mysticmind
image.png
I fixed the Algolia search config, the search is showing up fine now
Arun Pereira
@apereiratl
We do need some additional docs. I will put out a commit in the next few days. Work's been a bit spicy.
Kim Lund Johansen
@kimlundjohansen
Can you read the current version of a stream using IDocumentStore and what's best way?
Oskar Dudycz
@oskardudycz
33 replies
Arto Piironen
@artopiir_twitter
Hi all! I've been exploring Marten for a project I'm working on and so far it seems very promising. We're using event sourcing and DDD aggregates and some of the events created should also be made available as DDD-style "Domain Events". I would like to be able to have other aggregates inside the same bounded context to react to these events. Furthermore, some of them should be written to external message system so that other services can react to them. So far I've been thinking about adding an asyncronous projection that just publishes all events through MediatR and then we could have handlers that do stuff on those events. However it does seem a bit complicated so I thought it would be nice to know if anyone else has done similar things with Marten and how did you solve them.
Oskar Dudycz
@oskardudycz
Hi Arto, if you don't mind using Jasper, check Jeremy's post: https://jeremydmiller.com/2022/06/16/building-a-more-useful-outbox-for-reliable-messaging/
If you'd like to have it handled on your own, you can use your own outbox as custom IProjection that I presented here: https://event-driven.io/en/integrating_Marten/
Jeremy D. Miller
@jeremydmiller
That and we will be adding Oskar's Subscription approach to Marten soon. Not besmirching MediatR, but I'm not sure that's the best tool for that particular job.
I'm not using MediatR, as I'm doing more magic around tracing, retry policies etc. but you can do the same with MediatR id you'd like to.
Arto Piironen
@artopiir_twitter
Thanks for the quick reply guys! I think that both Jasper and Oskar's approach seem promising and trying out Jasper has been on my todo-list for a while. I'll try out both and see how it turns out. I have no particular need to use MediatR either, I think that with these I might actually be able to boot it from the project.
Jeremy D. Miller
@jeremydmiller
There will be a new Jasper alpha this week, but it's all focused on better error handling and robustness. Next Marten feature release will have subscriptions, then back to Jasper to support that there. The goal being having Jasper + Marten support for both publishing some subset of the events captured in Marten immediately through Jasper's outbox or being able to publish Marten events with a strong ordering guarantee through Jasper
Conservatively let's say within 2 weeks
Oskar Dudycz
@oskardudycz
Feel free to send us feedback
It's probably the last time to do that, but as I know some of people are already using the approach I described, so the one in Marten will be (probably) conceptually similar
Of course, Jasper approach is more ready, as I see Jeremy's putting lots of effort on Jasper, so in the long term it may be worth considering it :)
Arto Piironen
@artopiir_twitter
Yes, I'll get back to you when I've tried it out! We're still in the early stages right now so I'm also glad to try out any new features as they become available. :)
Oskar Dudycz
@oskardudycz
:+1:
JT
@Hawxy
Query, We have a project with only inline projections and thus we don't run the async daemon outside of rebuilds. In one of our newer environments with a small number of events we ran into a problem yesterday whereby the high water mark only updated mid-rebuild which caused some problems later down the line.
image.png
I assume the rebuild process was built with the idea that the daemon has always been previously running and thus no at-least-once detection of the high water mark occurs?
dionfoster
@dionfoster
I think i've managed to reproduce an issue with inline projections halting at gaps, I've thrown this PR up for review/discussion:
JasperFx/marten#2313
jeez, going back to a conversation we were having on the 26th July, where'd that time go?
redwraith
@redwraith:matrix.org
[m]
hi all 👋 going through the docs I noticed Marten doesn't support Intersect Linq operator. Is there any alternative way to achieve this functionality? I'm trying to check if two arrays intersect in Marten query.
4 replies
Oskar Dudycz
@oskardudycz

@/all I started to work on the Marten API for Upcasting events data. I'd like to add a built-in tooling for simple payload transformations. You could use that if your event schema has changed and you'd like to use new event types in your aggregates and projections. Those transformations will be run during the serialisation phase, so upcasting on the fly old event data into the new one.

I added two types of upcasters:

  • CLR types - when you're fine with keeping old event payload then it'll at first deserialise it, and you can map to the new one,
  • Raw json transformations, more flexible, less allocation, but a bit more tedious.

I have an early draft, of it, I'd be grateful for your feedback, especially about the public API (e.g. accessibility, naming, etc.).

https://github.com/JasperFx/marten/pull/2314/files#diff-530572fa09e2864ed0df01ade900998ed7c26a12d7dc2ace6666d7be76214dc6R22

Technically, this is what I described in my blog article: https://event-driven.io/en/simple_events_versioning_patterns/

Thoughts?

Oskar Dudycz
@oskardudycz
https://twitter.com/oskar_at_net/status/1555854977700184064 - would be greateful for RT to get more feedback :)
Oskar Dudycz
@oskardudycz
I did another roundtrip and trimmed implementation more.
philiplorenz-code
@philiplorenz-code
Is the dataflow between marten framework and postgres encrypted in any way? Which possibilities do I have therefor?
Jeremy D. Miller
@jeremydmiller
That's all Postgresql & Npgsql. Start here maybe: https://www.npgsql.org/doc/security.html?tabs=tabid-1
philiplorenz-code
@philiplorenz-code
So when enabling the SSL-feature on Postgres it will automatically be encrypted?
Jeremy D. Miller
@jeremydmiller
I'm going to have to direct you to those docs, I haven't used it personally
Joe Nathan Abellard
@jabellard
I have a question regarding the Marten Linq Provider. How come it can understand a query such as querySession.Query<Book>().Where(b => true).ToList();
But can not understand a query such as querySession.Query<Book>().Where(b => b != null).ToList();
In the end, these queries don't really filter anything out , but I'm curious to know why the first one is executed successfully where the second one keeps triggering an exception.
Jeremy D. Miller
@jeremydmiller
Do you understand how Linq works by chance?
Joe Nathan Abellard
@jabellard
Some knowledge, but don't know too much about the inner workings.
Jeremy D. Miller
@jeremydmiller
Okay, so the Linq provider never executes your code, rather it's an interpreter. Meaning that we have to anticipate and in many cases explicitly code for every single possible usage in order for that to work. The well lit paths are going to be fine. Oddball things that we didn't anticipate anybody every using like Where(x => x == null), are probably not going to have explicit support.
So the next question is, why in the world would you possibly do that?
Joe Nathan Abellard
@jabellard
Good question. I'm not wrtiting these queries manually myself. I'm currently trying to integrate the HotChocolate GraphQl library with Marten. It comes with out of the box support with some nice features like liftering (https://chillicream.com/docs/hotchocolate/fetching-data/filtering), which works by converting the graphql arguments into an expression tree that it then will apply to the IMartenQueryable. Let's say I have a Book object which as a Rating property. If I want to filter by that property, It will generate an expression that looks like $_s0 != null && $_s0.Rating == 10 instead of just $_s0.Rating == 10. That first part of the expression is what is causing the problem.
Jeremy D. Miller
@jeremydmiller
Blech, my first guess was that it was something like that
And that's such a horrendously inefficient way to do that
Gotta go, I'll be back. You submitted an issue for this anyway, righ?
Joe Nathan Abellard
@jabellard
Not yet. I'll submit one. I can also work on putting an enhancement that will fix this if you can point me in the right direction on how to go about resolving it.
Jeremy D. Miller
@jeremydmiller
Start in LinqHandlerBuilder and look for where the Where clauses are interpreted. Somehow gonna have to catch and interpret this as no where clause. Don't go in expecting this to be a simple if/then statement anywhere:(
Joe Nathan Abellard
@jabellard
Challenge accepted.
Jannik Buschke
@jannikbuschke
Is it reasonable to set a UserId Header on any session like this? Do people something similar or is putting a user id on metadata not something you usually want to do?
public class ScopedSessionFactory: ISessionFactory
    {
        private readonly IDocumentStore store;
        private readonly IUserService userService;

        public ScopedSessionFactory(IDocumentStore store, IUserService userService)
        {
            this.store = store;
            this.userService = userService;
        }

        public IQuerySession QuerySession()
        {
            return store.QuerySession();
        }

        public IDocumentSession OpenSession()
        {
            var session = store.LightweightSession();

            var userId = userService.GetUserId();
            session.SetHeader("UserId", userId);
            return session;
        }
    }
Oskar Dudycz
@oskardudycz
I think that's reasonable, just beware about GDPR :)
5 replies
Jannik Buschke
@jannikbuschke

Are these diagnostic messages normal/expected? I get them several times per second
`
[14:31:51 INF] High Water agent is stale after threshold of 3 seconds, skipping gap to events marked after 08/08/2022 12:30:20 +00:00

[14:31:51 INF] Daemon projection high water detection skipping a gap in event sequence, determined that the 'safe harbor' sequence is at null
`

Jeremy D. Miller
@jeremydmiller
@jannikbuschke It’s not the sign of a healthy running system. Is that happening at the same time you’re getting a lot of system failures?