Archiving the NServiceBus Message Archive

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 - , , .

+3
2

. , NSB ReturnToSourceQueue.exe, . , - , . NetApp, SnapMirror , , .

+1

# 3 BusDriver:

BusDriver is a command-line utility used to administer queues, service bus instances and other things related to MassTransit.

Command-Line Reference

  busdriver.exe [verb] [-option:value] [--switch]

    help, --help        Displays help

    count               Counts the number of messages in the specified
                        queue

      -uri              The URI of the queue

    peek                Displays the body of messages in the queue without
                        removing the messages

      -uri              The URI of the queue
      -count            The number of messages to display

    move                Move messages from one queue to another

      -from             The URI of the source queue
      -to               The URI of the destination queue
      -count            The number of messages to move

    requeue             Requeue messages from one queue to another

      -uri              The URI of the queue
      -count            The number of messages to move

    save                Save messages from a queue to a set of files

      -uri              The URI of the source queue
      -file             The name of the file to write to (will have .1, .2
                        appended automatically for each message)
      -count            The number of messages to save
      --remove          If set, the messages will be removed from the queue

    load                Load messages from a set of files into a queue

      -uri              The URI of the destination queue
      -file             The name of the file to read from (will have .1, .2
                        appended automatically for each message)
      -count            The number of messages to load
      --remove          If set, the message file will be removed once the
                        message has been loaded

    trace               Request a trace of messages that have been received
                        by a service bus

      -uri              The URI of the control bus for the service bus
                        instance
      -count            The number of messages to request

        status          Request a status probe of the bus at the endpoint

          -uri          The URI of the control bus for the service bus instance

    exit, quit          Exit the interactive console (run without arguments
                        to start the interactive console)

Examples:

    count -uri:msmq://localhost/mt_server
        Returns the number of messages that are present in the local
        MSMQ private queue named "mt_server"

    peek -uri:msmq://localhost/mt_client
        Displays the body of the first message present in the local
        MSMQ private queue named "mt_client"

    trace -uri:msmq://localhost/mt_subscriptions
        Requests and displays a trace of the last 100 messages received
        by the mt_subscriptions (the default queue name used by the
        subscription service, which is part of the RuntimeServices)

    move -from:msmq://localhost/mt_server_error -to:msmq://localhost/mt_server
        Moves one message from the mt_server_error queue to the mt_server
        queue (typically done to reprocess a message that was previously
        moved to the error queue due to a processing error, etc.)
+1

All Articles