Submits a message to the Message Feed server. Before submitting a message, the authenticate method must be called to authenticate to the server.
A message can be submitted either using a file path or an input stream, hence the two alternative method syntaxes.
A message is submitted to a specified integration engine activity. The message consists of data and attributes and is optionally identified by a message ID.
The method returns the reply as an object of class MfpSubmitMessageReply.
core.mfp.Mfp
submitMessage
public MfpSubmitMessageReply
submitMessage (String integration, String activity, String filePath, MfpAttribute attributes[ ], String messageId, int acknowledge, int timeout) throws MfpException
public MfpSubmitMessageReply
submitMessage(String integration, String activity, InputStream dataStream, MfpAttribute attributes[ ], String messageId, int acknowledge, int timeout) throws MfpException
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.filePath
– The file path to the data part of the message being submitted. The file being referred is automatically deleted after it has been submitted.dataStream
– An input stream used to stream the data to the Message Feed server rather than using a regular file. The data from the input stream is read from the current position until the end of the input stream. The input stream must be opened and closed by the method invoking the submitMessage
method.attributes
An array of class MfpAttribute
objects containing the attributes for the submitted message.messageId
– Identifies the message with a user-defined message identifier.acknowledge
– Specifies the type of acknowledgement being expected for the submitted message. It can one of the folloiwing:Mfp.ACKNOWLEDGE_COMMIT
– Expect that the submitted message is successfully queued and secured in the Message Feed server.Mfp.ACKNOWLEDGE_STATUS
– Expect a reply status for the submitted message.Mfp.ACKNOWLEDGE_STATUSMESSAGE
– Expect a reply message for the submitted message. timeout
– Specifies the timeout, in seconds, for processing the submitted message in the specified activity.The submitMessage
method throws an MfpException
when authentication fails.
Use the MfpException.toString method to get a textual description of the exception.