Invoke_Message

NOTE: This procedure is deprecated. Use Invoke_Record_Impersonate.

The Invoke_Message function synchronously sends an application message to all addresses and waits for the reply. Any outbound routing rules will be applied before the message is sent. If multiple addresses are specified, either programmatically or by routing rules, the message is sent to all addresses.

This function returns only if the message was successfully sent to all addresses. If even one address fails an exception will be raised.

Invoke_Message works like a standard remote function call, with the differences that the parameter is always an application message, and the entire messaging and IFS Connect frameworks may be involved in the invocation. Because of this Invoke_Message can be used to synchronously invoke any IFS Connect connector.

PROCEDURE Invoke_Message (
   application_message_ IN OUT type_record_ );

Parameters

application_message
    The application message to send.

Record handling

Invoke_Message will not delete the input/output record. To prevent superfluous consumption of temporary tablespace, a PLSQLAP_Record_API.Clear_Record procedure call must be issued when finished the processing the record.

Example

DECLARE
   am_   PLSQLAP_Record_API.type_record_;
   body_ PLSQLAP_Record_API.type_record_;
BEGIN
   -- create an application message
   am_ := PLSQLAP_Record_API.New_Record('APPLICATION_MESSAGE');
   PLSQLAP_Record_API.Set_Value(am_, 'MESSAGE_TYPE', 'TEST');
   
   body_ := PLSQLAP_Record_API.New_Record('TEXT_BODY');
   PLSQLAP_Record_API.Add_Aggregate(am_, 'TEXT_BODY', body_);
   PLSQLAP_Record_API.Set_Value(body_, 'TEXT_BODY_TYPE', 'STR');
   PLSQLAP_Record_API.Set_Value(body_, 'TEXT_VALUE', 'Hello world! from PLSQL access provider');
   
   PLSQLAP_Record_API.Debug(am_);       -- message before invoke

   -- invoke the message through IFS Connect. The message will be routed according to configured message
   -- routing, and all transport connectors invoked. If any connector invocation fails an exception is
   -- raised.
   PLSQLAP_Server_API.Invoke_Message(am_);

   PLSQLAP_Record_API.Debug(am_);        -- message after invoke
   PLSQLAP_Record_API.Clear_Record(am_); -- remove record from temporary tablespace
END;