What should I put into my Serv-U MSMQ messages? - KB Article #2093Related Articles --
Serv-U MFT Server allows administrators to write MSMQ messages when Serv-U events fire. This allows enterprise applications to "listen for" or "consume" Serv-U events and pull applicable files, upload additional files, make changes, or send their own alerts.
This article recommends a set of information and delimiters that should allow most queue receivers to make informed decisions about Serv-U events.
Recommended Message Format
In general, we recommend providing the following information, delimited by the pipe ("|") character.
- Name of the server on which event was fired (and not "localhost")
- IP of the client that initiated the event
- Username of the user that initiated the event
- Date and time event fired
- Full relative path of file (for transfers)
- Full physical path of file (for transfers)
- File size (for transfers)
A message string that contains all this information is shown below.
The "Label" Message Property
Serv-U sets the value of the message label to the type of event that triggered the action. For example, a "file upload" event will bear a "FILE_UPLOADED" label.
Other Suggested Fields
Depending on your needs, you may also want to include transfer protocol information ("$Protocol"), the domain involved - especially on multi-domain machines ("$DomainName"), and the email address of the user involved ("$UserEmailAddress") with your events. Review Serv-U's current list of System Variables for other options.
A string containing all the recommended fields from above plus these three is shown below.
.NET Application Shops
Programmers used to working with System.Messaging in a .NET environment may be surprised to see that Serv-U does not write out messages in XML format. However, it is easy to configure Serv-U to write messages in this format. To accomplish this, simply surround your message with "<?xml version="1.0"?> <string>" and "</string>" tags as shown below.
<?xml version="1.0"?> <string>YOUR_MESSAGE_HERE</string>