Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 06:59
    oskardudycz closed #2480
  • 06:59

    oskardudycz on master

    Updated Azure Pipelines connect… Fixes #2480 - Increased paralle… (compare)

  • 06:59
    oskardudycz closed #2480
  • 06:59

    oskardudycz on master

    Updated Azure Pipelines connect… Fixes #2480 - Increased paralle… (compare)

  • 06:59

    oskardudycz on parallel_patching_ci

    (compare)

  • 06:59

    oskardudycz on parallel_patching_ci

    (compare)

  • 06:59
    oskardudycz closed #2468
  • 06:59
    oskardudycz closed #2468
  • 06:26
    oskardudycz synchronize #2468
  • 06:26
    oskardudycz synchronize #2468
  • 06:26

    oskardudycz on parallel_patching_ci

    Fixes #2480 - Increased paralle… (compare)

  • 06:26

    oskardudycz on parallel_patching_ci

    Fixes #2480 - Increased paralle… (compare)

  • 06:12
    oskardudycz edited #2468
  • 06:12
    oskardudycz edited #2468
  • 06:11
    oskardudycz edited #2468
  • 06:11
    oskardudycz edited #2468
  • 06:10
    oskardudycz edited #2468
  • 06:10
    oskardudycz edited #2468
  • 06:10
    oskardudycz synchronize #2468
  • 06:10
    oskardudycz synchronize #2468
Jeremy D. Miller
@jeremydmiller
Nice!
Marcus
@ColonelBundy
@jeremydmiller Great. May I suggest support for dependency injection in IProjection? Right now you need to create them yourself, I assume there's a reason for it but DI would be very helpful for injecting configuration and what not.
Jeremy D. Miller
@jeremydmiller
That comes up a lot, but it's possibly through the flavor of AddMarten() that takes in IServiceProvider. There's room for a helper for it to make that easier, just hasn't gotten played yet.
Marcus
@ColonelBundy
Gotcha
Jeremy D. Miller
@jeremydmiller
Not exactly telling you "I take pull requests", but kinda:-)
Oskar Dudycz
@oskardudycz
Do we really want to pull back my „LazyLoadedProjection” 😅
Jeremy D. Miller
@jeremydmiller
I think there's other ways to do that, but maybe. We've got the IConfigureMarten hook to do composite configuration. One thing we could do is something like AddMarten(blah blah blah).AddProjection<MyProjectionType>(lifetime), and the second chained call adds an IConfigureMarten to the container, which could pull MyProjectionType out of the container.
Oskar Dudycz
@oskardudycz
Yup, but as a person that implemented the initial version in v2, I can say that we eventually dropped it, as it wasn’t the ideal way.
Still, for some cases like custom Iprojection, it’s valid scenario
I can add it
Jeremy D. Miller
@jeremydmiller
:thumbsup: I'd slightly favor a non-Lazy approach though
On a semi-related note, there's some low hanging fruit soon to create some slight alternatives to IProjection for custom things where you just let users get a page of events at a time, or maybe expose a single ApplyEvent() method so you don't have the goofy "take a page, group it by stream, immediately turn it back into the original page of events" dance we do internally for custom projections
Like to do that before we add your Subscription stuff directly to Marten
Marcus
@ColonelBundy
@jeremydmiller Creating the dbcontext and utlizing the connection from IDocumentOperations on a EventProjection worked flawlessly, now the projection and events get inserted in the same transaction. Thanks.
One gotcha for future reference, ef core's autotransactions need to be disabled (can be done per connection basis)
Jeremy D. Miller
@jeremydmiller
Call me pleasantly surprised then
Marcus
@ColonelBundy
This is of course for an inline projection though, haven't tested async yet.
Shawn de Wet
@shawndewet_twitter

I've implemented full text search, and am busy running some tests. Here is a sample of two entries in the database:
[
{
"id": "M02.02",
"code": "M02.02",
"description": "ARTHROPATHY FOLLOWING INTESTINAL BYPASS UPPER ARM"
},
{
"id": "M02.03",
"code": "M02.03",
"description": "ARTHROPATHY FOLLOWING INTESTINAL BYPASS FOREARM"
}
]

I have a scenario in which the test input is "intestinal bypass arm", and using PhraseSearch, PlainTextSearch and WebStyleSearch all return only the first record. How do I need to structure my index (or my code) in order to get both records for the given search term?
btw, it's worth mentioning that NgramSearch returns both records, but it takes over 6 seconds to do so.

Arun Pereira
@apereiratl
Add an NgramIndex in your registry for the fields that you need to perform such a search on. It will return immediately since it uses proper indexing with postgres.

For example,

.Duplicate(x => x.Description)
.NgramIndex(x => x.Description)

ps: I contributed the feature so you have specific questions or issues with it, please @ me.
Jeremy D. Miller
@jeremydmiller
Thanks for helping support the full text search @apereiratl!
Arun Pereira
@apereiratl
@jeremydmiller Happy to help. It's great to see others using the feature :)
Shawn de Wet
@shawndewet_twitter
Thanks @apereiratl. Impressive performance of .NgramIndex. returns in 6ms!
1 reply
Babu Annamalai
@mysticmind
@apereiratl ngram index is a good addition to Marten. Appreciate your support to answering questions on it.
See if we need to add any further info to the docs. May be an expanded example to add clarity(?).
Babu Annamalai
@mysticmind
image.png
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.