Skip to main content

Managing Messages

This page describes how to resend messages, how to handle suspended messages, and how to export messages.

Resending Messages

If a message failed to be delivered, you can correct the problem that resulted in the failure, and then resend the message.

You can resend messages from the Management Portal or using a programmatic solution. A programmatic solution is more efficient for resending 100 or more messages at a time.

Resending Messages from the Management Portal

  1. Access the Interoperability > View > Messages page.

  2. Select the messages by selecting the check boxes in the left column. Or filter the display appropriately and then click the check box at the top of the left column.

    If you need to edit messages before resending them, then select a single message. You cannot use the Edit and Resend option (shown later) if you select multiple messages on this page.

  3. Select Resend Messages.

  4. If you checked the check box at the top of the left column and if there are multiple pages of selected messages, the system then displays the following message:

    More messages match your search criteria than appear here. If you want to resend all the messages that match your criteria, including those not shown on this page, click OK. To resend only your selected messages, click Cancel.

    Now do one of the following:

    • Select OK to continue with all the selected messages.

    • Select Cancel to continue with only the selected messages that were visible on the first page.

    In either case, you can later cancel the action.

  5. The system then displays details for the selected messages. The table includes the following information:

    • Session—The session to which each message belongs. Click this to view the visual trace of the primary message object through the production. See Sessions.

    • Header—The ID for the message header (also the message ID). Click this to view the visual trace of this specific message. See Message Basics.

    • Msg Body—The ID for the message body. Click this to view the message contents.

    • Created—The message creation time stamp. See Invocation Style and Message Time Stamps.

    • Source—The business host that sent the message.

    • Target—The business host that was intended to receive the message. This field also indicates if the production target is not running; note that you cannot resend a message if the intended target is not running. Click this to see the contents of the target’s message queue.

    If you selected more than 1000 messages, only the first 1000 are shown, but the page indicates the total number that you selected.

  6. Optionally select a new target business host. To do so, select a value for New target.

  7. Optionally select Resubmit at head of queue.

    If you do so, InterSystems IRIS places the resent message at the front of its target queue. This helps to preserve FIFO (first in, first out) processing when the order of messages is important.

    Important:

    Before using this option, first disable the target component temporarily. This enables the production to build up the queue in the expected order, so that the target does not take messages from the queue before you have finished adding all the messages you want to resend.

  8. Click one of the following:

    • Cancel—To cancel this action.

    • Resend—To resend the message or messages as specified.

    • Edit and Resend—To edit the message and resend it as specified. See the subsection for details.

When you resend multiple messages, InterSystems IRIS resends them in order by age, starting with the oldest messages.

When you resend the messages, the page is redisplayed with an additional Resend Status column. Any status other than OK indicates that the resend operation failed. A resent message retains the same Session identifier and transmits the same message body, but acquires a new message header (with a new, unique ID) to mark its additional trip through the production. The visual trace includes both the original message transmission and any resend operations that involve the same message. The description in the message header contains text indicating this message has been resent; the description includes the original along with any subsequent header object identifiers.

Resend Editor

When you select one message to resend from the Message Viewer page, you have the option to edit the body of the message before resending it.

  1. Click Edit then Resend to display the Resend Editor page.

  2. Use the entry fields to update the message body data. The fields vary depending on the message. If the message has no properties, none are displayed.

    If you are editing a virtual document message, you can edit data in the message content and also edit object properties in the box below the content box.

  3. Click Resend to send a new copy of the message header with your edited message body to the target.

  4. After a successful resend, the page refreshes with text indicating the new Header and Msg Body identifiers. Click Trace to see the visual trace of the resent message.

Resending Messages Programmatically

A programmatic solution is more efficient than the Message Viewer page for resending large numbers of messages. To do this, use the ResendDuplicatedMessage()Opens in a new tab method of the Ens.MessageHeaderOpens in a new tab. The following example uses this method with an SQL cursor:

    //Resend all messages sent from 'FromComponent' to 'ToComponent' between 2022-06-15 and 2022-06-20
    &sql(DECLARE C1 CURSOR FOR
    SELECT ID INTO :id FROM Ens.MessageHeader
    WHERE SourceConfigName='FromComponent' AND TargetConfigName='ToComponent'
    AND TimeCreated BETWEEN '2022-06-15' AND '2022-06-20')

    &sql(OPEN C1)
    &sql(FETCH C1)

    set tSC = $$$OK

    while (SQLCODE = 0) {
        //id holds the id for one message. Resend it
        set tSC = ##class(Ens.MessageHeader).ResendDuplicatedMessage(id)
        quit:$$$ISERR(tSC)
        &sql(FETCH C1)
    }

    &sql(CLOSE C1)
    quit tSC

Managing Suspended Messages

Suspended messages require user intervention. A message can become suspended for multiple reasons:

  • A business operation can suspend a message in the case of failure, for example, when the message cannot be delivered. This depends upon the implementation of the business operation.

  • The sending business host can suspend a message depending on Reply Code Actions setting and the reply received for the message.

  • If the sending business host stops before processing a synchronous message, that message becomes suspended. This can occur when a business host is stopped manually or when a production is forcibly stopped.

    When a message that is sent synchronously, the sending business host expects a response and must be running in order to receive a response. If the sending business host is stopped, the message is suspended because it cannot be processed. In contract, when a message is sent asynchronously, the work is not dependent on a specific business host and there is no need to suspend it.

  • A user can manually suspend a message.

InterSystems IRIS automatically places all Suspended messages on a special queue, shown in the Interoperability > View > Suspended Messages page of the Management Portal. You can use this page to determine why the message failed, fix the problem, and then resend the message. For example, if the problem is that an external destination went out of service, you can make a change to reestablish communication with that server. Then you can resubmit the suspended messages to the external server from this page. Or you can discard or delete the message.

To manage suspended messages, do the following:

  1. Navigate to the Interoperability > View > Suspended Messages page.

  2. If any messages in the currently running production are suspended, the system lists them in a table with the following information:

    • ID—The ID of the message. See Message Basics.

    • Time Created—The message creation time stamp. See Invocation Style and Message Time Stamps.

    • Session—The ID of the session associated with this message. See Sessions.

    • Error?—A quick overview of the results returned by the message to the business host that sent it.

      OK means normal behavior; Retry means the message experienced a failure but the business host that sent it is configured to retry the failed message. Error means an error was reported somewhere in the activity. Inactive means that the business host that sent the message has been idle for longer than its Inactivity Timeout setting, and may require diagnostic action.

    • Source Configuration Name—The business host that sent the message.

  3. Select the messages by selecting the check boxes in the left column.

  4. Then use any of the following buttons:

    • Resubmit—Click this to resubmit the messages. As message similar to the following displays for each successfully resubmitted message:

      Resubmit suspended message ID '7' completed.
      

      Any message that you resubmit retains the same Session identifier and transmits the same Header object. The description in the message header contains text indicating this is a Resubmitted message.

    • Edit & Resubmit—Click this to edit a single message before resubmitting; this command is only valid if you select exactly one message. See the following subsection for details.

    • Discard—Click this to remove the message from list on this page. The message is still accessible from the Message Viewer, and its status is now Discarded.

    • Delete—Click this to remove all record of the message from the InterSystems IRIS database.

    Caution:

    You cannot undo the Discard or Delete operations.

Any message that you edit and resubmit retains the same Session identifier and includes the same Header object, but it contains a new Msg Body object with a new identifier. The description in the original message header contains text indicating that this message has been resubmitted and includes the original Msg Body object identifier.

Resend Editor for Resubmitting Messages

When you select one message to resubmit from the Interoperability > View > Suspended Messages page, you can edit the body of the message before resubmitting it.

  1. Select Edit & Resubmit to display the Resend Editor page.

  2. Use the entry fields to update the message body data. The fields vary depending on the method signature of the message. If the method has no properties, none are displayed.

    If you are editing a virtual document message, you can edit data in the message content and also edit object properties in the box below the content box.

  3. Select Resubmit to resubmit the original message header with your edited message body contents to the target.

  4. After a successful resubmit, the page refreshes with text indicating the Header and Msg Body identifiers. Click Trace to see the visual trace of the resubmitted message.

Exporting Messages

You can download multiple messages to your local machine using the Export button of the Message Viewer, which you access from Interoperability > View > Messages . Clicking the Export button brings up a dialog box where you can specify the name of the export file, how you want to separate the messages within the file, and the character set used. The export file is downloaded to your local machine using your browser’s built-in download capabilities. You must have USE permissions for the %Ens_MessageExport resource to export messages.

Exporting Large Quantities of Messages

To prevent you from accidentally exporting a very large quantity of messages, the process for exporting large quantities is more complex. If you select all messages, but there are more messages returned by the search than fit on the results page, you must have access to the Workflow Inbox to complete the export process. For administrative instructions on giving users access to the Workflow Inbox, see Giving Users Access to Workflow Inbox .

To export large quantities of messages:

  1. Go to Interoperability > View > Messages and search for the messages you want to export.

  2. Click the check box in the header of the search results page to select all messages.

  3. Click Export .

    A dialog box appears that indicates that you have selected more messages than appear on the search results page.

  4. Click OK .

  5. Specify the name of the download file, how you want messages separated in the file, and the character set used.

  6. Click OK twice.

  7. Go the InterSystems IRIS home page.

  8. Go to Analytics > User Portal . The current namespace must be enabled for Analytics to complete this step.

  9. Click Workflow Inbox.

  10. Select the message in the Workflow Inbox and click Confirm in the body of the message.

  11. Wait until a new message titled “Exported File available for download” appears in the Workflow Inbox, then select the message.

  12. Click Download in the body of the message.

  13. When the file has been successfully downloaded by the browser, click Completed Download to remove the temporary file from the server.

Note:

You cannot download messages if they exceed 50% of the free disk space in the directory specified by %SYS("TempDir", namespace ) .

Giving Users Access to Workflow Inbox

You must have proper credentials to complete these steps. The user will not be able to access the Workflow Inbox unless the namespace is enabled for Analytics.

  1. Go to Interoperability > Manage > Workflow > Workflow Users.

  2. Select the user’s name from the Name drop-down list.

  3. Select Active.

  4. Click Save.

  5. Go to Interoperability > Manage > Workflow > Workflow Roles.

  6. In the Name field, enter: %ProductionMessageExport and click Save.

  7. Select the new role from the list and click Add.

  8. Select the user’s name from the User Name drop-down list and click OK.

Note:

If you want to change whether the user must confirm the download of multiple messages or who needs to confirm the export, add the EnsLib.Background.Process.ExportMessageSearchOpens in a new tab class to the production and edit the WorkFlow Settings.

See Also

FeedbackOpens in a new tab