Gets the reply to a request to the Message Feed server.
Note: The MFP.GetReply
statement is blocking. To avoid blocking the program while waiting for the reply, use the MFP.GetSocket
function to obtain a socket that can be used with the Message Builder REGISTER module to wait for the socket to be ready for read or write access.
MFP.GetReply hMFP [Timeout timeout] Reply reply;
hMFP
– The handle to the Message Feed connection.Timeout
– The timeout, in seconds, to wait for the reply. This timeout is not the same timeout as the socket access timeout defined in the MFP.Connect
function. This is an optional expression of type integer. The default value is 60 seconds.reply
– An output parameter of type record MFP.Reply
:
DECLARE PUBLIC RECORD Reply { DECLARE PUBLIC $RequestType STRING; DECLARE PUBLIC $RequestId STRING; DECLARE PUBLIC $Status INTEGER; DECLARE PUBLIC $SubmitMessage RECORD ReplySubmitMessage; } |
$RequestType
is:MFP.$RequestType_Authenticate
– if it is a reply to an MFP.Authenticate
requestMFP.$RequestType_Submitmessage
– if it is a reply to an MFP.SubmitMessage
request.$RequestId
is the same request ID as supplied in the MFP.Authenticate
or MFP.SubmitMessage
statements.$Status
is the status of the request. Use the MFP.StatusToString
function to get a textual description of the status. The status can be one of the following:MFP.$ReplyStatus_Ok
– The request was processed successfully.MFP.$ReplyStatus_AuthenticateInvaliddata
– A MFP.Authenticate request contained invalid data.MFP.$ReplyStatus_AuthenticateAuthenticationfail
– The user or password in an MFP.Authenticate statement was invalid.MFP.$ReplyStatus_SubmitmessageInvaliddata
– A MFP.SubmitMessage request contained invalid data.MFP.$ReplyStatus_SubmitmessageNotauthenticated
– Trying to submit a message without having authenticated to the Message Feed server.MFP.$ReplyStatus_SubmitmessageUnknownactivity
– The integration or activity parameters in the MFP.SubmitMessage statement refers an activity that is not known by the Message Feed server.MFP.$ReplyStatus_SubmitmessageInvalidfile
– The file-path parameter in the MFP.SubmitMessage statement does not refer a valid file.MFP.$ReplyStatus_SubmitmessageUnknownqueue
– The integration and activity parameters in the MFP.SubmitMessage statement refers an activity for which a queue does not exist. This error indicates an inconsistent run- time configuration in the system where the Message Feed server runs.MFP.$ReplyStatus_SubmitmessageServererror
– An internal error occurred in the Message Feed server.MFP.$ReplyStatus_SubmitmessageTimeout
– No reply was received from the Message Feed server within the specified timeout.$SubmitMessage
is valid when the reply is related to an MFP.SubmitMessage
request. This field has a structure of type MFP.ReplySubmitMessage
as defined here:
DECLARE PUBLIC RECORD ReplySubmitMessage { DECLARE PUBLIC $FilePath STRING; DECLARE PUBLIC $MessageId STRING; DECLARE PUBLIC $LoggerId STRING; DECLARE PUBLIC $Status INTEGER; } |
$FilePath
is only set when a reply message was requested in the MFP.SubmitMessage
statement. In this case, this field specifies the file path to the reply message.$MessageId
specifies the user-defined message ID of the message being submitted. This is the same as the message-id parameter in the MFP.SubmitMessage
statement.$LoggerId
specifies the logger ID assigned for the submitted message by the Message Feed server. The logger ID uniquely identifies a message in the integration engine.$Status
specifies the processing status of the submitted message. The status can be:MFP.$SubmitMessage_Status_Ok
– The submitted message was processed OK.MFP.$SubmitMessage_Status_Partialerror
– The submitted message was processed with some errors, i.e. one or several of the messages created from the submitted message was stopped.MFP.$SubmitMessage_Status_Error
– The submitted message was processed with error: All messages created from the submitted message were stopped.MFP.$SubmitMessage_Status_Timeout
– The submitted message was not processed within the timeout specified in the MFP.SubmitMessage statement
.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_ErrorGetreplyInvalidid
– The hMFP
parameter refers an unknown connection handle.MFP.$Error_ErrorGetreplyFailed
– Failed to get the reply from the Message Feed server.
INCLUDE "mfp.s4h"; ... DECLARE $hMFP RECORD MFP.Handle; DECLARE $Reply RECORD MFP.Reply; $hMFP = MFP.Connect("localhost", "12345", 60); MFP.Authenticate $hMFP User "user" Password "passwd"; MFP.GetReply $hMFP Reply $Reply; IF $Reply.$Status <> MFP.$ReplyStatus_Ok { LOG FORMAT("failed to authenticate: %s", MFP.StatusToString($Reply.$Status)); EXIT 1; } MFP.Disconnect $hMFP; ... |