cqrs

nservicebus saga property injection with ninject

孤人 提交于 2019-12-12 03:12:29
问题 I am using ninject when configuring NSB. Here is how I register: public class EndpointConfig : IConfigureThisEndpoint, AsA_Publisher, IWantCustomInitialization { #region Implementation of IWantCustomInitialization public void Init() { var kernel = new StandardKernel(); Configure.With().NinjectBuilder(kernel); kernel.Load(new BackendModule()); } #endregion } public class BackendModule : NinjectModule { #region Overrides of NinjectModule /// <summary> /// Loads the module into the kernel. /// <

How to keep customer data segregated

孤街浪徒 提交于 2019-12-12 02:40:03
问题 As a simplified example I have users, products and customers. Users are allowed access to certain products and to certain customers. I'm using an edmx-file to map my SQL Server to my code and get the data using linq. A typical query might look something like this: from prod in ctx.Products join userProduct in ctx.UserProduct on prod.Id equals userProduct.ProductId join user in ctx.UserProfile on userProduct.UserId equals user.Id where user.UserName == username // <-- username is a method

How do you handle foreign-keys read-side failures in CQRS?

不羁岁月 提交于 2019-12-11 18:46:09
问题 You have table A and table B in your SQL data model, with table A having a foreign key towards table B. You now want to migrate your CRUD architecture to CQRS. Imagine the following scenario: You receive a command to persist a new entry of A You write to your append log and process it updating your state The read side picks it up and fail to insert in the database In this situation, your write side and read side will never reach consistency. How do you handle read-side constraints in CQRS?

EventStore & RavenDB Persistence JsonReaderException

白昼怎懂夜的黑 提交于 2019-12-11 11:16:23
问题 Trying to wire up JOliver's EventStore with RavenDB and hit a snag. I created a new DB in Raven called RavenEventStore. The following is my wireup; return Wireup.Init() .UsingRavenPersistence("RavenEventStore") .UsingAsynchronousDispatchScheduler() .DispatchTo(new DelegateMessageDispatcher(DispatchCommit)) .Build(); When the Wireup.Init() is called, this exception is occuring on the RavenDb side; Url: "/indexes/RavenCommitByDate" Newtonsoft.Json.JsonReaderException: Unexpected character

In CQRS how to work with NServiceBus to update Command and Query store

若如初见. 提交于 2019-12-11 10:46:23
问题 In CQRS, how do you make sure a command handler is updating the write store and read store transactionally? I am not sure if these two steps are suppoed to be a transaction? Or do you rely on eventual consistency here? Meaning the read store will be updated eventually? What is the (or a) common way to do this using NServiceBus 5 or 6? In our application, we have IRepository<T> (Add, Update) for the command side to update Sql Server database. The query side is simple. A database and a facade

Does Wolkenkit event-sourcing have a scheduler?

久未见 提交于 2019-12-11 09:03:19
问题 I'd like to schedule time-triggered actions to fire off events at both intervals and specific times. This would be useful if I needed to say, change the aggregate state with some events like meetingStarted and meetingEnded based on something like a start_at and end_at for a room-booking service. 回答1: Right now, wolkenkit does not have a scheduler like this. Adding this is on the roadmap, but currently it's not yet implemented. Please note that I am one of the developers of wolkenkit, so

CQRS Read models in a NoSql (Mongo DB)

你离开我真会死。 提交于 2019-12-11 07:17:49
问题 Hi its my fist time with DDD/CQRS. I've read multiple sources of knowledge and Im still confused a bit, maybe someone could help :) Lets assume simple case that we have products and clients (possibly different bounded contexts). A client can buy a product and he wants to see all products that he purchased. In this case I realize I need a UserPurchasesView view model with: purchaseId (which is a mongo primary key) userId, product: {id, name, image, shortDescription, [maybe some others]} prize

What layer should contain Queries in DDD

允我心安 提交于 2019-12-11 05:23:57
问题 I have a simple DDD service, with Article Aggregate root. I use MediatR and CQRS for separation of commands and queries. In DDD domain should not have dependencies on application and infrastructure layers. I have a repository IArticleRepository for composing some data from articles database. I have a rest endpoint for getting articles by some kind of filters so that I create ArticleQuery : IRequest<ArticleDto(or Article)> And when this query object should be? I have a repository per aggregate

Why does the RetryScheduler in Axon Framework not retry after a NoHandlerForCommandException?

我们两清 提交于 2019-12-11 05:03:53
问题 so I have a Saga and the Saga sends a command to a different microservice on a specific event. I wanted to configure the commandGateway with a RetryScheduler, so that it retries to send the command in case that the other microservice is down. The RetryScheduler will only perform retries if the exception is a RuntimeException, which the NoHandlerForCommandException that is thrown when the other service if offline definately is. If i dont set the maxRetryCount then the error message is o.a.c

NServicebus publishing event - recieves empty message

天大地大妈咪最大 提交于 2019-12-11 04:24:01
问题 I keep recieving the following message from my denormalizer host after publishing an event in my domain: 2011-07-22 14:18:32,374 [Worker.5] WARN NServiceBus.Unicast.UnicastBus [(null)] <(null)> - Received an empty message - ignoring. I am just doing this with jolivers eventstore: return Wireup.Init() .UsingRavenPersistence("EventStore", new DocumentObjectSerializer()) .UsingAsynchronousDispatcher() .PublishTo(new DelegateMessagePublisher(c => container.Resolve<IPublishMessages>().Publish(c)))