cqrs

Design Commands And Events while Handling External partner with Axon 4

末鹿安然 提交于 2019-12-13 13:25:33
问题 This is a question related to designing command handling with Axon 4. Let say I've a domain that model the concept of a Payment . The actual payment will be done by an external Partner. I want to track it in my system via the following events: a Payment Request Was Issued followed by either Partner Agreed the Payment or Partner Declined the Payment . Every events issued by the command should be enrolled in the same database transaction. What would be the best practice to actually call my

Calculate Key for WebService Update from Sql Query in Navision 2009

淺唱寂寞╮ 提交于 2019-12-13 05:12:08
问题 I am exposing some Pages in Navision 2009 as web services. To update a record, you have to issue a Read request, and send the Key field along with your Update request. I would rather calculate the Key myself for 2 reasons: Using the filters in the read request is awkward - a sql query would fit on one line. Performance is terrible. I've been able to figure out that at least part of the key is a Base64 encoded string of the columns that make up the primary key. I hope that someone can tell me

In DDD/CQRS, should ReadModel act as ViewModel, if not then where belongs responsibility for mapping?

孤者浪人 提交于 2019-12-13 04:25:40
问题 Assume read model ProductCatalogueItem is built from aggregates/write-models, stored separately from write-models, and contains each product available for selling, and has following properties: basics: product_code , name , price , number_of_available_stock , documentation: short_description , description ,... product characteristics: weight , length , depth , width , color ,... And, there are two views: product list containing list/table/grid of available product offers, and the view needs

Subscribe to category stream, event never appears in subscription client

十年热恋 提交于 2019-12-12 19:09:28
问题 Being a first time user of GetEventStore and having read the docs, I have an issue where events never appears on my subscription client. This is possible due to a configuration step I've missed. Having this console application client: public class EventStoreSubscriptionClient : ISubscriptionClient { private const string GroupName = "liner"; private const string StreamName = "$ce-happening"; private readonly IProvideEventStoreConnection _eventStoreConnection; private readonly UserCredentials

CQRS - Event replay for read side

a 夏天 提交于 2019-12-12 18:28:12
问题 I have read several blogs on CQRS and all of them explain that at write-side events are persisted on event store and upon a request, events are retrieved and replayed on aggregate. My question is why doesn't event replay on an aggregate is required at read side? 回答1: Because your read side doesn't use aggregates. Read side is implemented as projections which calculate the current state from the stream of events emited by aggregates and persist the current state in some pesistent store or in

Microservices Create Entity Implementation

让人想犯罪 __ 提交于 2019-12-12 17:11:55
问题 This is a follow-up question to my issue outlined here. The Gateway serves as an entry point to the application, to which every request from the client is made. The gateway then allocates the request to the responsible microservices and also handles authentication. In this case the gateway listens for HTTP POST /bok and notifies the Microservice A to create a book. Thus Microservice A ist responsible for managing and storing everything about the book entity. The following pseudo-code is a

Is CQRS correct for my domain?

一世执手 提交于 2019-12-12 14:50:02
问题 I am modelling an archive which is part of an video demand system. Think of the archive like windows explorer where multiple users can create folders, upload videos, restructure folders etc. There are business rules (permissions) which determine if the user is allowed to do the task (i.e. rename folder, move folders, view folders etc). I have modeled each folder as an aggregate root and moving one folder to another folder appears to affect two aggregate roots. From what I understand is I

Register a MediatR pipeline with void/Task response

送分小仙女□ 提交于 2019-12-12 10:47:35
问题 My command: public class Command : IRequest { ... } My handler: public class CommandHandler : IAsyncRequestHandler<Command> { ... } My pipeline registration (not using open generics): services.AddTransient<IPipelineBehavior<Command>, MyBehavior<Command>>(); However this doesn't work: Using the generic type 'IPipelineBehavior<TRequest, TResponse>' requires 2 type arguments. And same error for MyBehavior . The docs mention the Unit struct. How do I use it? 回答1: As Mickaël Derriey pointed out,

CQRS - When to send confirmation message?

半腔热情 提交于 2019-12-12 08:24:49
问题 Example: Business rules states that the customer should get a confirmation message (email or similar) when an order has been placed. Lets say that a NewOrderRegisteredEvent is dispatched from the domain and is picked up by an event listener that sends of the confirmation message. When that is done some other event handler throws an exception or something else goes wrong and the unit of work is rolled back. We've now sent the user a confirmation message for something that was rolled back. What

CQRS with Legacy Systems

旧城冷巷雨未停 提交于 2019-12-12 07:57:19
问题 I'm looking to convert a relatively new web-based application with a clear domain model over to more of a CQRS style system. My new application is essentially an enhanced replacement of an older existing system. The existing systems in my organization share a set of common databases, which are updated by an untold number of applications (developed via the Chaos Method) that exist in silos throughout the company. (As it stands, I believe that no single person in the company can identify them