Submits a message to the Message Feed server. Before submitting a message, the MFP.Authenticate
statement must be called to authenticate to the server.
A message is being submitted to a specified activity. The message consists of data and attributes and is optionally identified by a message ID.
MFP.SubmitMessage hMFP [RequestId request-id] Integration integration Activity activity FilePath file-path [Attributes attributes] [MessageId message-id] [Acknowledge acknowledge] [Timeout timeout];
hMFP
– The handle to the Message Feed connection. It is a record of type MFP.Handle
.request-id
– Identifies this request. It is returned in the reply received by the MFP.GetReply
statement in order to correlate a reply with its request. It is an optional expression of type integer
.integration
– Specifies in which integration the activity exists. This is a qualified name containing any folders and integration name separated by the slash (/) character. The sequence \\ is used to specify a single \ character in a folder or integration name. The sequence \/ is used to specify a single / character in the folder or integration name. This parameter is an expression of type string
.activity
– Specifies the name of the activity in which the submitted message should be processed. This parameter is an expression of type string
.file-path
– The file path to the data part of the message being submitted. The file being referred is automatically deleted after it has been submitted. This parameter is an expression of type string
.attributes
– An optional array of attribute records of type MFP.Attribute
, defined as:
DECLARE PUBLIC RECORD Attribute { DECLARE PUBLIC $Name STRING; DECLARE PUBLIC $Value STRING; } |
message-id
– Identifies the message with a user-defined message identifier. This is an optional expression of type string
.acknowledge
– Specifies the type of acknowledgement expected for the submitted message. It can be:MFP.$SubmitMessage_Acknowledge_Commit
– Expect that the submitted message is successfully queued and secured in the Message Feed Server.MFP.$SubmitMessage_Acknowledge_Status
– Expect a reply status for the submitted message. This is the default value.MFP.$SubmitMessage_Acknowledge_Statusmessage
– Expect a reply message for thesubmitted message.timeout
– Specifies the timeout, in seconds, for processing the submitted message in the specified activity. This is an optional expression of type integer
. The default value is 60 seconds.When an error occurs, the function throws an exception of type MFP.$Exception
and sets the $Error
reserved variable to one of the values:
MFP.$Error_ErrorSubmitMessageInvalidid
– The hMFP
parameter refers an unknown connection handle.MFP.$Error_ErrorSubmitMessageFailed
– Failed to send the submit message request to the Message Feed server.
... DECLARE $Attributes[] RECORD MFP.Attribute; DECLARE $StatusDescription STRING; Attributes[1].$Name = "MyAttribute"; Attributes[2].$Value = "somedata"; MFP.SubmitMessage $hMFP Integration "MyFolder/MyIntegration" Activity "MyActivity" FilePath "msg.dat" Attributes $Attributes MessageId "Id123"; MFP.GetReply $hMFP Reply $Reply; IF $Reply.$Status <> MFP.$ReplyStatus_Ok { LOG FORMAT("failed to submit message: %s", MFP.StatusToString($Reply.$Status)); EXIT 1; } CASE $Reply.$SubmitMessage.$Status WHEN MFP.$SubmitMessage_Status_Ok { $StatusDescription = "Ok"; } WHEN MFP.$SubmitMessage_Status_Partialerror { $StatusDescription = "Partial error"; } WHEN MFP.$SubmitMessage_Status_Error { $StatusDescription = "Error"; } WHEN MFP.$SubmitMessage_Status_Timeout { $StatusDescription = "Timeout"; } WHEN OTHERS { $StatusDescription = "Unknown"; } PRINT FORMAT("LoggerId\t%s\n",$Reply$SubmitMessage.$LoggerId); PRINT FORMAT("Status\t%s\n", $StatusDescription); ... |