mqseries_back

MQSeries MQBACK

说明

void mqseries_back ( resource $hconn , resource &$compCode , resource &$reason )

The mqseries_back (MQBACK) call indicates to the queue manager that all the message gets and puts that have occurred since the last syncpoint are to be backed out. Messages put as part of a unit of work are deleted; messages retrieved as part of a unit of work are reinstated on the queue.

Using mqseries_back only works in conjunction with mqseries_begin and only function when connecting directly to a Queueu manager. Not via the mqclient interface.

参数

hConn
Connection handle.

This handle represents the connection to the queue manager.

compCode
Completion code.

reason
Reason code qualifying the compCode.

返回值

没有返回值。

范例

示例 #1 mqseries_back example

<?php
    mqseries_back($conn, $comp_code, $reason);

    if ($comp_code !== MQSERIES_MQCC_OK) {
        printf("CompCode:%d Reason:%d Text:%s<br>\n", $comp_code, $reason, mqseries_strerror($reason));
    }
?>

注释

Note:

mqseries_back will not function when using MQSeries Client to connect to a Queueu Manager.

参见

  • mqseries_conn
  • mqseries_connx
  • mqseries_begin

mqseries_begin

MQseries MQBEGIN

说明

void mqseries_begin ( resource $hconn , array $beginOptions , resource &$compCode , resource &$reason )

The mqseries_begin (MQBEGIN) call begins a unit of work that is coordinated by the queue manager, and that may involve external resource managers.

Using mqseries_begin starts the unit of work. Either mqseries_back or mqseries_cmit ends the unit of work.

参数

hConn
Connection handle.

This handle represents the connection to the queue manager.

compCode
Completion code.

reason
Reason code qualifying the compCode.

返回值

没有返回值。

范例

示例 #1 mqseries_begin example

<?php
    $mqbo = array();
    mqseries_begin( $conn, 
                    $mqbo,
                    $comp_code,
                    $reason);
    if ($comp_code !== MQSERIES_MQCC_OK) {
        /* reason code 2121 is a warning for more information see MQSeries reference manual.*/
        if ($reason !== 2121) {
            printf("CompCode:%d Reason:%d Text:%s<br>\n", $comp_code, $reason, mqseries_strerror($reason));
        }
    }
?>

注释

Note:

mqseries_begin will not function when using MQSeries Client to connect to a Queueu Manager.

参见

  • mqseries_conn
  • mqseries_connx
  • mqseries_back
  • mqseries_cmit

mqseries_close

MQSeries MQCLOSE

说明

void mqseries_close ( resource $hconn , resource $hobj , int $options , resource &$compCode , resource &$reason )

The mqseries_close (MQCLOSE) call relinquishes access to an object, and is the inverse of the mqseries_open (MQOPEN) call.

参数

hConn
Connection handle.

This handle represents the connection to the queue manager.

hObj
Object handle.

This handle represents the object to be used.

options

compCode
Completion code.

reason
Reason code qualifying the compCode.

返回值

没有返回值。

范例

示例 #1 mqseries_close example

<?php
    mqseries_close($conn, $obj, MQSERIES_MQCO_NONE, $comp_code, $reason);
    if ($comp_code !== MQSERIES_MQCC_OK) {
        printf("close CompCode:%d Reason:%d Text:%s<br>\n", $comp_code, $reason, mqseries_strerror($reason));
    }
?>

参见

  • mqseries_open
  • mqseries_conn
  • mqseries_connx

mqseries_cmit

MQSeries MQCMIT

说明

void mqseries_cmit ( resource $hconn , resource &$compCode , resource &$reason )

The mqseries_cmit (MQCMIT) call indicates to the queue manager that the application has reached a syncpoint, and that all of the message gets and puts that have occurred since the last syncpoint are to be made permanent. Messages put as part of a unit of work are made available to other applications; messages retrieved as part of a unit of work are deleted.

参数

hConn
Connection handle.

This handle represents the connection to the queue manager.

compCode
Completion code.

reason
Reason code qualifying the compCode.

返回值

没有返回值。

范例

示例 #1 mqseries_cmit example

<?php
    mqseries_cmit($conn, $comp_code, $reason);
    if ($comp_code !== MQSERIES_MQCC_OK) {
        printf("cmit CompCode:%d Reason:%d Text:%s<br>\n", $comp_code, $reason, mqseries_strerror($reason));
    }
?>

注释

Note:

mqseries_back will not function when using MQSeries Client to connect to a Queueu Manager.

参见

  • mqseries_begin
  • mqseries_back
  • mqseries_conn
  • mqseries_connx

mqseries_conn

MQSeries MQCONN

说明

void mqseries_conn ( string $qManagerName , resource &$hconn , resource &$compCode , resource &$reason )

The mqseries_conn (MQCONN) call connects an application program to a queue manager. It provides a queue manager connection handle, which is used by the application on subsequent message queuing calls.

参数

qManagerName
Name of queue manager.

Name of the queue manager the application wishes to connect.

hConn
Connection handle.

This handle represents the connection to the queue manager.

compCode
Completion code.

reason
Reason code qualifying the compCode.

返回值

没有返回值。

范例

示例 #1 mqseries_conn example

<?php
    mqseries_conn('WMQ1', $conn, $comp_code, $reason);
    if ($comp_code !== MQSERIES_MQCC_OK) {
        printf("conn CompCode:%d Reason:%d Text:%s<br>\n", $comp_code, $reason, mqseries_strerror($reason));
        exit;
    }
?>

参见

  • mqseries_disc

mqseries_connx

MQSeries MQCONNX

说明

void mqseries_connx ( string $qManagerName , array &$connOptions , resource &$hconn , resource &$compCode , resource &$reason )

The mqseries_connx (MQCONNX) call connects an application program to a queue manager. It provides a queue manager connection handle, which is used by the application on subsequent MQ calls.

The mqseries_connx call is like the mqseries_conn (MQCONN) call, except that MQCONNX allows options to be specified to control the way that the call works.

参数

qManagerName
Name of queue manager.

Name of the queue manager the application wishes to connect.

connOps
Options that control the action of function

See also the MQCNO structure.

hConn
Connection handle.

This handle represents the connection to the queue manager.

compCode
Completion code.

reason
Reason code qualifying the compCode.

返回值

没有返回值。

范例

示例 #1 mqseries_connx example

<?php
    $mqcno = array(
        'Version' => MQSERIES_MQCNO_VERSION_2,
        'Options' => MQSERIES_MQCNO_STANDARD_BINDING,
        'MQCD' => array('ChannelName' => 'MQNX9420.CLIENT',
        'ConnectionName' => 'localhost',
        'TransportType' => MQSERIES_MQXPT_TCP)
    );

    mqseries_connx('MQNX9420', $mqcno, $conn, $comp_code,$reason);
    if ($comp_code !== MQSERIES_MQCC_OK) {
        printf("Connx CompCode:%d Reason:%d Text:%s<br>\n", $comp_code, $reason, mqseries_strerror($reason));
        exit;
    }
 
?>

示例 #2 mqseries_connx example using SSL connection & OCSP Responder URL

<?php
    $mqcno = array(
        'Version' => 4, //MQCNO_VERSION_4
        'Options' => MQSERIES_MQCNO_STANDARD_BINDING,
        'MQCD' => array(
            'Version' => 7, //MQCD_VERSION_7
            'ConnectionName' => 'localhost', 
            'TransportType' => MQSERIES_MQXPT_TCP, 
            'ChannelName' => 'CONNECTIONCHANNEL', 
            'SSLCipherSpec' => 'NULL_SHA'
        ), 
        'MQSCO' => array(
            'KeyRepository' => '/var/mqm/qmgrs/QUEUEMGR/ssl/key', //Local path where the SSL key repository can be found
            'MQAIR' => array(
                'Version' => 2, //MQAIR_VERSION_2
                'AuthInfoType' => 2, //MQAIT_OCSP 
                'OCSPResponderURL' => 'http://dummy.OCSP.responder'
            )
        )
    );

    mqseries_connx('QUEUEMGR', $mqcno, $conn, $comp_code,$reason);
    if ($comp_code !== MQSERIES_MQCC_OK) {
        printf("Connx CompCode:%d Reason:%d Text:%s<br>\n", $comp_code, $reason, mqseries_strerror($reason));
        exit;
    }
 
?>

参见

  • mqseries_disc

mqseries_disc

MQSeries MQDISC

说明

void mqseries_disc ( resource $hconn , resource &$compCode , resource &$reason )

The mqseries_disc (MQDISC) call breaks the connection between the queue manager and the application program, and is the inverse of the mqseries_conn (MQCONN) or mqseries_connx (MQCONNX) call.

参数

hConn
Connection handle.

This handle represents the connection to the queue manager.

compCode
Completion code.

reason
Reason code qualifying the compCode.

返回值

没有返回值。

范例

示例 #1 mqseries_disc example

<?php
    mqseries_disc($conn, $comp_code, $reason);
    if ($comp_code !== MQSERIES_MQCC_OK) {
        printf("disc CompCode:%d Reason:%d Text:%s<br>\n", $comp_code, $reason, mqseries_strerror($reason));
    }
?>

参见

  • mqseries_conn
  • mqseries_connx

mqseries_get

MQSeries MQGET

说明

void mqseries_get ( resource $hConn , resource $hObj , array &$md , array &$gmo , int &$bufferLength , string &$msg , int &$data_length , resource &$compCode , resource &$reason )

The mqseries_get (MQGET) call retrieves a message from a local queue that has been opened using the mqseries_open (MQOPEN) call

参数

hConn
Connection handle.

This handle represents the connection to the queue manager.

hObj
Object handle.

This handle represents the object to be used.

md
Message descriptor (MQMD).

gmo
Get message options (MQGMO).

bufferLength
Expected length of the result buffer

msg
Buffer holding the message that was retrieved from the object.

data_length
Actual buffer length

compCode
Completion code.

reason
Reason code qualifying the compCode.

返回值

没有返回值。

范例

示例 #1 mqseries_get example

<?php
// open connection to the queue manager
    mqseries_conn('WMQ1', $conn, $comp_code, $reason);
// $conn now hold the reference to the connection to the queue manager.

// open the connection to the testq queue
    mqseries_open(
                $conn,
                array('ObjectName' => 'TESTQ'),
                MQSERIES_MQOO_INPUT_AS_Q_DEF | MQSERIES_MQOO_FAIL_IF_QUIESCING | MQSERIES_MQOO_OUTPUT,
                $obj,
                $comp_code,
                $reason);
// $obj now holds the reference to the object (TESTQ)

// setup empty message descriptor.
    $mdg = array();
// setup get message options    
    $gmo = array('Options' => MQSERIES_MQGMO_FAIL_IF_QUIESCING | MQSERIES_MQGMO_WAIT, 'WaitInterval' => 3000);

// get the message from the queue    
    mqseries_get($conn, $obj, $mdg, $gmo, 255, $msg, $data_length, $comp_code, $reason);
    if ($comp_code !== MQSERIES_MQCC_OK) {
        printf("GET CompCode:%d Reason:%d Text:%s<br>", $comp_code, $reason, mqseries_strerror($reason));
    }
    
// close the object reference $obj    
    mqseries_close($conn, $obj, MQSERIES_MQCO_NONE, $comp_code, $reason);

// disconnect from the queue manager.    
    mqseries_disc($conn, $comp_code, $reason);
    
?>

参见

  • mqseries_conn
  • mqseries_connx
  • mqseries_open
  • mqseries_put

mqseries_inq

MQSeries MQINQ

说明

void mqseries_inq ( resource $hconn , resource $hobj , int $selectorCount , array $selectors , int $intAttrCount , resource &$intAttr , int $charAttrLength , resource &$charAttr , resource &$compCode , resource &$reason )

The mqseries_inq (MQINQ) call returns an array of integers and a set of character strings containing the attributes of an object.

参数

hConn
Connection handle.

This handle represents the connection to the queue manager.

hObj
Object handle.

This handle represents the object to be used.

selectorCount
Count of selectors.

selectors
Array of attribute selectors.

intAttrLength
Count of integer attributes.

intAttr
Array of integer attributes.

charAttrLength
Length of character attributes buffer.

charAttr
Character attributes.

compCode
Completion code.

reason
Reason code qualifying the compCode.

返回值

没有返回值。

范例

示例 #1 mqseries_inq example

<?php
    $int_attr = array();
    $char_attr = "";
    
    mqseries_inq($conn, $obj, 1, array(MQSERIES_MQCA_Q_MGR_NAME), 0, $int_attr, 48, $char_attr, $comp_code, $reason);
    
    if ($comp_code !== MQSERIES_MQCC_OK) {
        printf("INQ CompCode:%d Reason:%d Text:%s<br>\n", $comp_code, $reason, mqseries_strerror($reason));
    } else {
        echo "INQ QManager name result ".$char_attr."<br>\n";
    }
?>

参见

  • mqseries_conn
  • mqseries_connx
  • mqseries_open

mqseries_open

MQSeries MQOPEN

说明

void mqseries_open ( resource $hconn , array &$objDesc , int $option , resource &$hobj , resource &$compCode , resource &$reason )

The mqseries_open (MQOPEN) call establishes access to an object.

参数

hConn
Connection handle.

This handle represents the connection to the queue manager.

objDesc
Object descriptor. (MQOD)

options
Options that control the action of the function.

hObj
Object handle.

This handle represents the object to be used.

compCode
Completion code.

reason
Reason code qualifying the compCode.

返回值

没有返回值。

范例

示例 #1 mqseries_open example

<?php
    $mqods = array('ObjectName' => 'TESTQ');
    mqseries_open(
                $conn,
                $mqods,
                MQSERIES_MQOO_INPUT_AS_Q_DEF | MQSERIES_MQOO_FAIL_IF_QUIESCING | MQSERIES_MQOO_OUTPUT,
                $obj,
                $comp_code,
                $reason);
    if ($comp_code !== MQSERIES_MQCC_OK) {
        printf("open CompCode:%d Reason:%d Text:%s<br>\n", $comp_code, $reason, mqseries_strerror($reason));
        exit;
    }
?>

参见

  • mqseries_close

mqseries_put1

MQSeries MQPUT1

说明

void mqseries_put1 ( resource $hconn , resource &$objDesc , resource &$msgDesc , resource &$pmo , string $buffer , resource &$compCode , resource &$reason )

The mqseries_put1 (MQPUT1) call puts one message on a queue. The queue need not be open.

You can use both the mqseries_put and mqseries_put1 calls to put messages on a queue; which call to use depends on the circumstances. Use the mqseries_put (MQPUT) call to place multiple messages on the same queue. Use the mqseries_put1 (MQPUT1) call to put only one message on a queue. This call encapsulates the MQOPEN, MQPUT, and MQCLOSE calls into a single call, minimizing the number of calls that must be issued.

参数

hConn
Connection handle.

This handle represents the connection to the queue manager.

objDesc
Object descriptor. (MQOD)

This is a structure which identifies the queue to which the message is added.

msgDesc
Message descriptor (MQMD).

pmo
Put message options (MQPMO).

compCode
Completion code.

reason
Reason code qualifying the compCode.

返回值

没有返回值。

参见

  • mqseries_conn
  • mqseries_connx
  • mqseries_open
  • mqseries_get

mqseries_put

MQSeries MQPUT

说明

void mqseries_put ( resource $hConn , resource $hObj , array &$md , array &$pmo , string $message , resource &$compCode , resource &$reason )

The mqseries_put (MQPUT) call puts a message on a queue or distribution list. The queue or distribution list must already be open.

参数

hConn
Connection handle.

This handle represents the connection to the queue manager.

hObj
Object handle.

This handle represents the object to be used.

md
Message descriptor (MQMD).

pmo
Put message options (MQPMO).

message
The actual message to put onto the queue.

compCode
Completion code.

reason
Reason code qualifying the compCode.

返回值

没有返回值。

范例

示例 #1 mqseries_put example

<?php
// open connection to the queue manager
    mqseries_conn('WMQ1', $conn, $comp_code, $reason);
// $conn now hold the reference to the connection to the queue manager.

// open the connectio to the testq queueu
    mqseries_open(
                $conn,
                array('ObjectName' => 'TESTQ'),
                MQSERIES_MQOO_INPUT_AS_Q_DEF | MQSERIES_MQOO_FAIL_IF_QUIESCING | MQSERIES_MQOO_OUTPUT,
                $obj,
                $comp_code,
                $reason);
// $obj now holds the reference to the object (TESTQ)

// setup the message descriptor array. Check MQSeries reference manuals.
    $md = array(
                'Version' => MQSERIES_MQMD_VERSION_1,
                'Expiry' => MQSERIES_MQEI_UNLIMITED,
                'Report' => MQSERIES_MQRO_NONE,
                'MsgType' => MQSERIES_MQMT_DATAGRAM,
                'Format' => MQSERIES_MQFMT_STRING,
                'Priority' => 1,
                'Persistence' => MQSERIES_MQPER_PERSISTENT);

// setup the put message options.
    $pmo = array('Options' => MQSERIES_MQPMO_NEW_MSG_ID|MQSERIES_MQPMO_SYNCPOINT);
    
// put the message 'Ping' on the queueu.
    mqseries_put($conn, $obj, $md, $pmo, 'Ping', $comp_code, $reason);

    if ($comp_code !== MQSERIES_MQCC_OK) {
        printf("put CompCode:%d Reason:%d Text:%s<br>\n", $comp_code, $reason, mqseries_strerror($reason));
    }

// close the object reference $obj    
    mqseries_close($conn, $obj, MQSERIES_MQCO_NONE, $comp_code, $reason);

// disconnect from the queue manager.    
    mqseries_disc($conn, $comp_code, $reason);
    
?>

参见

  • mqseries_conn
  • mqseries_connx
  • mqseries_open
  • mqseries_get

mqseries_set

MQSeries MQSET

说明

void mqseries_set ( resource $hConn , resource $hObj , int $selectorCount , array $selectors , int $intAttrCount , array $intAttrs , int $charAttrLength , array $charAttrs , resource &$compCode , resource &$reason )

The mqseries_set (MQSET) call is used to change the attributes of an object represented by a handle. The object must be a queue.

参数

hConn
Connection handle.

This handle represents the connection to the queue manager.

hObj
Object handle.

This handle represents the object to be used.

selectorCount
Count of selectors.

selectors
Array of attribute selectors.

intAttrCount
Count of integer attributes.

intAttrs
Array of integer attributes.

charAttrLength
Length of character attributes buffer.

charAttrs
Character attributes.

compCode
Completion code.

reason
Reason code qualifying the compCode.

返回值

没有返回值。

参见

  • mqseries_inq

mqseries_strerror

Returns the error message corresponding to a result code (MQRC)

说明

string mqseries_strerror ( int $reason )

mqseries_strerror returns the message that correspond to the reason result code.

参数

reason
Reason code qualifying the compCode.

返回值

string representation of the reason code message.

范例

示例 #1 mqseries_strerror example

<?php
    if ($comp_code !== MQSERIES_MQCC_OK) {
        printf("open CompCode:%d Reason:%d Text:%s<br>\n", $comp_code, $reason, mqseries_strerror($reason));
        exit;
    }
?>

以上例程会输出:

Connx CompCode:2 Reason:2059 Text:Queue manager not available for connection.                    

目录