0

We have some CRUD web apps running at a client and we'll need to implement an auditing system to track changes made by users in any of these products.

Ex.:

  • User ABC created a new Trade (in trades app)
  • User DEF changed address information of Client with id 123 (in clients app)

I was thinking about an event based solution with a message queue where all of our services would publish a message whenever a change is made by any user and the auditing service would be the subscriber of all of these messages.

Some of the advantages of this model:

  • The old services will have minor changes (repositories will start to publish messages)
  • All the auditing logic and data will be centralized in a single project

What do you guys think about this approach and what should I keep in mind?

Marcelo Oliveira
  • 653
  • 5
  • 16

1 Answers1

1

Hy You tagged this under NserviceBus so I'm going to answer from NServiceBus perspective. The idea is good and pretty simple to achieve with NServiceBus. If you apply publish and subscribe with NServiceBus you get auditing for free. Just specify the audit queue in the configuration.

<!-- You can control the TimeToBeREceived on messages going to the audit queue  -->
<!-- by using the TimeToBeReceivedOnForwardedMessages setting -->
<UnicastBusConfig ForwardReceivedMessagesTo="AuditQueue@AdminMachine" >
  <MessageEndpointMappings>
    <!-- rest of your configuration here -->
  </MessageEndpointMappings>
</UnicastBusConfig>
Daniel Marbach
  • 2,294
  • 12
  • 15