I am creating an application that should keep copies of sent messages so that I can play all messages at a later stage. This is necessary because message processing will change dramatically during development, but the data should be recorded as soon as possible, as this is real-time observation data. It seems that I do not see any built-in functions that directly access this, and although I could write my own tool for saving data, which, apparently, contradicts the purpose of using NServiceBus in the first place. Some options I'm considering:
Use the ForwardReceivedMessagesTo function of the target bus to create an archive queue and create a simple application that uses this archive queue as an input queue to easily forward messages to the target bus whenever the Replayer tool is launched. This clears the archive queue, requiring it to be copied first with the mqbkup utility, but it can be automated as part of the playback process. Alternatively, using two alternating archive queues (one reception in new messages and one for replay) would allow this.
Use the publish / subscribe model and the Archiver subscriber subscribes to the target queue by placing the message in the archive queue. A Replayer tool similar to the one described above can use the archive queue as an input queue and redirect messages to Target. It will also clear the archive queue, requiring one of the solutions above.
The MassTransit people mention something called BusDriver , which allows copying between queues, but I can't find anything else.
My main task is to choose the approach that is least likely to lose data, as soon as an observation is made, it can never be done outside of a narrow time window. It seems like it should be a common problem, and yet I cannot find a direct solution. Suggestions?
Update. . , ( ), "". , , - - : (mqbkup MSMQ, ), , , MSMQ, NServiceBus. , MSMQ - , , .