Is it possible to enqueue the Audit to be processed later? #639
-
To offload from the main app the serialization and the saving process, I want to enqueue the audit serialization and saving processing to execute it later by another server. Is it possible? Before I knew Audit.NET I wanted to do something like this:
Is something similar to it possible with Audit.NET? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Certainly, you have the option to do that, but it depends on the location where you intend to maintain the queue. how do you anticipate the other server retrieving the generated audit? If you opt for Redis or Confluent Kafka, you may use the Audit.NET.Kafka or Audit.NET.Redis extensions. Alternatively, you have the flexibility to create a custom data provider to store the audit events. |
Beta Was this translation helpful? Give feedback.
I can't advise since there are many things to consider depending on your use cases.
But I can give you some examples.
A simple fire-and-forget mechanism can be achieved by creating a custom data provider that inherits from the real data provider and overrides the Insert methods to execute the insert in a different thread: