Using the alterMsgPub() and alterMsgSub() Functions

Two functions are available for creating callouts: alterMsgPub() is used to create a callout for a publisher, and alterMsgSub() is used to create a callout for a subscriber. You can use the alterMsgPub() and alterMsgSub() functions to alter messages in the TIBCO ActiveEnterprise Message and XML wire formats.

The alterMsgPub() and alterMsgSub() functions are the entry points into the callout library. These two function names and their signatures must not be changed.
The function signatures are:
public static void altermsgPub(String subj,
                   MInstance data,
                   MApp pMapp, int messageFormat)

public static void altermsgSub(String subj,
                   MInstance data,
                   MApp pMapp, int messageFormat)

The following figure shows the use of altermsgPub and altermsgSub functions.

Both functions share the same set of parameters. However, several parameters are specific to a particular wire format.

The following table contains parameter descriptions and a column for each format. If the M column contains an X, use the parameter for TIBCO ActiveEnterprise Message or XML wire format. Otherwise, leave the value as NULL.

Parameter M Description
subj X Subject on which the message is sent or received.
data MInstance of the data. Alter directly if necessary.
pMapp X TIBCO Adapter SDK MApp structure for this MInstance.
messageFormat X Format of a message.
The valid values are:
  • M_AERV_MESSAGE_FORMAT
  • M_XMLJMS_MESSAGE_FORMAT
  • M_XMLRV_MESSAGE_FORMAT

For details about these values, see TIBCO Adapter For SDK documentation.