Db2 MQ tables

The Db2 MQ tables contain service and policy definitions that are used by the Message Queue Interface (MQI) based Db2 MQ functions. You must populate the Db2 MQ tables before you can use these MQI-based functions.

The Db2 MQ tables are SYSIBM.MQSERVICE_TABLE and SYSIBM.MQPOLICY_TABLE. These tables are user-managed. You need to create them during the installation or migration process. Installation job DSNTIJRT creates these tables with one default row in each table.

If you previously used the AMI-based Db2 MQ functions, you used AMI configuration files instead of these tables. To use the MQI-based Db2 MQ functions, you need to move the data from those configuration files to the Db2 tables SYSIBM.MQSERVICE_TABLE and SYSIBM.MQPOLICY_TABLE .

The following table describes the columns for SYSIBM.MQSERVICE_TABLE.

Table 1. SYSIBM.MQSERVICE_TABLE column descriptions
Column name Description
SERVICENAME This column contains the service name, which is an optional input parameter of the MQ functions.

This column is the primary key for the SYSIBM.MQSERVICE_TABLE table.

QUEUEMANAGER This column contains the name of the queue manager where the MQ functions are to establish a connection.
INPUTQUEUE This column contains the name of the queue from which the MQ functions are to send and retrieve messages.
CODEDCHARSETID This column contains the character set identifier for character data in the messages that are sent and received by the MQ functions.

This column corresponds to the CodedCharSetId field in the message descriptor structure (MQMD). MQ functions use the value in this column to set the CodedCharSetId field.

The default value for this column is 0, which sets the CodedCharSetId field of the MQMD to the value MQCCSI_Q_MGR.

ENCODING This column contains the encoding value for the numeric data in the messages that are sent and received by the MQ functions.

This column corresponds to the Encoding field in the message descriptor structure (MQMD). MQ functions use the value in this column to set the Encoding field.

The default value for this column is 0, which sets the Encoding field in the MQMD to the value MQENC_NATIVE.

DESCRIPTION This column contains the description of the service.

The following table describes the columns for SYSIBM.MQPOLICY_TABLE.

Table 2. SYSIBM.MQPOLICY_TABLE column descriptions
Column name Description
POLICYNAME This column contains the policy name, which is an optional input parameter of the MQ functions.

This column is the primary key for the SYSIBM.MQPOLICY_TABLE table.

SEND_PRIORITY This column contains the priority of the message.

This column corresponds to the Priority field in the message descriptor structure (MQMD). MQ functions use the value in this column to set the Priority field.

The default value for this column is -1, which sets the Priority field in the MQMD to the value MQQPRI_PRIORITY_AS_Q_DEF.

SEND_PERSISTENCE This column indicates whether the message persists despite any system failures or instances of restarting the queue manager.

This column corresponds to the Persistence field in the message descriptor structure (MQMD). MQ functions use the value in this column to set the Persistence field.

This column can have the following values:
Q
Sets the Persistence field in the MQMD to the value MQPER_PERSISTENCE_AS_Q_DEF. This value is the default.
Y
Sets the Persistence field in the MQMD to the value MQPER_PERSISTENT.
N
Sets the Persistence field in the MQMD to the value MQPER_NOT_ PERSISTENT.
SEND_EXPIRY This column contains the message expiration time, in tenths of a second.

This column corresponds to the Expiry field in the message descriptor structure (MQMD). MQ functions use the value in this column to set the Expiry field.

The default value is -1, which sets the Expiry field to the value MQEI_UNLIMITED.

SEND_RETRY_COUNT This column contains the number of times that the MQ function is to try to send a message if the procedure fails.

The default value is 5.

SEND_RETRY_INTERVAL This column contains the interval, in milliseconds, between each attempt to send a message.

The default value is 1000.

SEND_NEW_CORRELID This column specifies how the correlation identifier is to be set if a correlation identifier is not passed as an input parameter in the MQ function. The correlation identifier is set in the CorrelId field in the message descriptor structure (MQMD).

This column can have one of the following values:

N
Sets the CorrelId field in the MQMD to binary zeros. This value is the default.
Y
Specifies that the queue manager is to generate a new correlation identifier and set the CorrelId field in the MQMD to that value. This 'Y' value is equivalent to setting the MQPMO_NEW_CORREL_ID option in the Options field in the put message options structure (MQPMO).
SEND_RESPONSE_MSGID This column specifies how the MsgId field in the message descriptor structure (MQMD) is to be set for report and reply messages.

This column corresponds to the Report field in the MQMD. MQ functions use the value in this column to set the Report field.

This column can have one of the following values:

N
Sets the MQRO_NEW_MSG_ID option in the Report field in the MQMD. This value is the default.
P
Sets the MQRO_PASS_MSG_ID option in the Report field in the MQMD.
SEND_RESPONSE_CORRELID This column specifies how the CorrelID field in the message descriptor structure (MQMD) is to be set for report and reply messages.

This column corresponds to the Report field in the MQMD. MQ functions use the value in this column to set the Report field.

This column can have one of the following values:

C
Sets the MQRO_COPY_MSG_ID_TO_CORREL_ID option in the Report field in the MQMD. This value is the default.
P
Sets the MQRO_PASS_CORREL_ID option in the Report field in the MQMD.
SEND_EXCEPTION_ACTION This column specifies what to do with the original message when it cannot be delivered to the destination queue.

This column corresponds to the Report field in the message descriptor structure (MQMD). MQ functions use the value in this column to set the Report field.

This column can have one of the following values:

Q
Sets the MQRO_DEAD_LETTER_Q option in the Report field in the MQMD. This value is the default.
D
Sets the MQRO_DISCARD_MSG option in the Report field in the MQMD.
P
Sets the MQRO_PASS_DISCARD_AND_EXPIRY option in the Report field in the MQMD.
SEND_REPORT_EXCEPTION This column specifies whether an exception report message is to be generated when a message cannot be delivered to the specified destination queue and if so, what that report message should contain.

This column corresponds to the Report field in the message descriptor structure (MQMD). MQ functions use the value in this column to set the Report field.

This column can have one of the following values:

N
Specifies that an exception report message is not to be generated. No options in the Report field are set. This value is the default.
E
Sets the MQRO_EXCEPTION option in the Report field in the MQMD.
D
Sets the MQRO_EXCEPTION_WITH_DATA option in the Report field in the MQMD.
F
Sets the MQRO_EXCEPTION_WITH_FULL_DATA option in the Report field in the MQMD.
SEND_REPORT_COA This column specifies whether the queue manager is to send a confirm-on-arrival (COA) report message when the message is placed in the destination queue, and if so, what that COA message is to contain.

This column corresponds to the Report field in the message descriptor structure (MQMD). MQ functions use the value in this column to set the Report field.

This column can have one of the following values:

N
Specifies that a COA message is not to be sent. No options in the Report field are set. This value is the default
C
Sets the MQRO_COA option in the Report field in the MQMD
D
Sets the MQRO_COA_WITH_DATA option in the Report field in the MQMD.
F
Sets the MQRO_COA_WITH_FULL_DATA option in the Report field in the MQMD.
SEND_REPORT_COD This column specifies whether the queue manager is to send a confirm-on-delivery (COD) report message when an application retrieves and deletes a message from the destination queue, and if so, what that COD message is to contain.

This column corresponds to the Report field in the message descriptor structure (MQMD). MQ functions use the value in this column to set the Report field.

This column can have one of the following values:

N
Specifies that a COD message is not to be sent. No options in the Report field are set. This value is the default.
C
Sets the MQRO_COD option in the Report field in the MQMD.
D
Sets the MQRO_COD_WITH_DATA option in the Report field in the MQMD.
F
Sets the MQRO_COD_WITH_FULL_DATA option in the Report field in the MQMD.
SEND_REPORT_EXPIRY This column specifies whether the queue manager is to send an expiration report message if a message is discarded before it is delivered to an application, and if so, what that message is to contain.

This column corresponds to the Report field in the message descriptor structure (MQMD). MQ functions use the value in this column to set the Report field.

This column can have one of the following values:
N
Specifies that an expiration report message is not to be sent. No options in the Report field are set.This value is the default.
C
Sets the MQRO_EXPIRATION option in the Report field in the MQMD.
D
Sets the MQRO_EXPIRATION_WITH_DATA option in the Report field in the MQMD.
F
Sets the MQRO_EXPIRATION_WITH_FULL_DATA option in the Report field in the MQMD.
SEND_REPORT_ACTION This column specifies whether the receiving application sends a positive action notification (PAN), a negative action notification (NAN), or both.

This column corresponds to the Report field in the message descriptor structure (MQMD). MQ functions use the value in this column to set the Report field.

This column can have one of the following values:

N
Specifies that neither notification is to be sent. No options in the Report field are set. This value is the default.
P
Sets the MQRO_PAN option in the Report field in the MQMD.
T
Sets the MQRO_NAN option in the Report field in the MQMD.
B
Sets both the MQRO_PAN and MQRO_NAN options in the Report field in the MQMD.
SEND_MSG_TYPE This column contains the type of message.

This column corresponds to the MsqType field in the message descriptor structure (MQMD). MQ functions use the value in this column to set the MsqType field.

This column can have one of the following values:
DTG
Sets the MsgType field in the MQMD to MQMT_DATAGRAM. This value is the default.
REQ
Sets the MsgType field in the MQMD to MQMT_REQUEST.
RLY
Sets the MsgType field in the MQMD to MQMT_REPLY.
RPT
Sets the MsgType field in the MQMD to MQMT_REPORT.
REPLY_TO_Q This column contains the name of the message queue to which the application that issued the MQGET call is to send reply and report messages.

This column corresponds to the ReplyToQ field in the message descriptor structure (MQMD). MQ functions use the value in this column to set the ReplyToQ field.

The default value for this column is SAME AS INPUT_Q, which sets the name to the queue name that is defined in the service that was used for sending the message. If no service was specified, the name is set to DB2MQ_DEFAULT_Q, which is the name of the input queue for the default service.

REPLY_TO_QMGR This column contains the name of the queue manager to which the reply and report messages are to be sent.

This column corresponds to the ReplyToQMgr field in the message descriptor structure (MQMD). MQ functions use the value in this column to set the ReplyToQMgr field.

The default value for this column is SAME AS INPUT_QMGR, which sets the name to the queue manager name that is defined in the service that was used for sending the message. If no service was specified, the name is set to the name of the queue manager for the default service.

RCV_WAIT_INTERVAL This column contains the time, in milliseconds, that Db2 is to wait for messages to arrive in the queue.

This column corresponds to the WaitInterval field in the get message options structure (MQGMO). MQ functions use the value in this column to set the WaitInterval field.

The default is 10.

RCV_CONVERT This column indicates whether to convert the application data in the message to conform to the CodedCharSetId and Encoding values of the specified MQ service.

This column corresponds to the Options field in the get message options structure (MQGMO). MQ functions use the value in this column to set the Options field.

This column can have one of the following values:

Y
Sets the MQGMO_CONVERT option in the Options field in the MQGMO. This value is the default.
N
Specifies that no data is to be converted.
RCV_ACCEPT_TRUNC_MSG This column specifies the behavior of the MQ function when oversized messages are retrieved.

This column corresponds to the Options field in the get message options structure (MQGMO). MQ functions use the value in this column to set the Options field.

This column can have one of the following values:

Y
Sets the MQGMO_ACCEPT_TRUNCATED_MSG option in the Options field in the MQGMO. This value is the default.
N
Specifies that no messages are to be truncated. If the message is too large to fit in the buffer, the MQ function terminates with an error.
Recommendation: Set this column to Y. In this case, if the message buffer is too small to hold the complete message, the MQ function can fill the buffer with as much of the message as the buffer can hold.
REV_OPEN_SHARED This column specifies the input queue mode when messages are retrieved.

This column corresponds to the Options parameter for an MQOPEN call. MQ functions use the value in this column to set the Options parameter.

This column can have one of the following values:

S
Sets the MQOO_INPUT_SHARED option. This value is the default.
E
Sets the MQ option MQOO_INPUT_EXCLUSIVE option.
D
Sets the MQ option MQOO_INPUT_AS_Q_DEF option.
SYNCPOINT This column indicates whether the MQ function is to operate within the protocol for a normal unit of work.

This column can have one of the following values:

Y
Specifies that the MQ function is to operate within the protocol for a normal unit of work. Use this value for two-phase commit environments. This value is the default.
N
Specifies that the MQ function is to operate outside the protocol for a normal unit of work. Use this value for one-phase commit environments.
DESC This column contains the description of the policy.