cmqchファイルのMQODは次のようになります。
/****************************************************************/
/* MQOD Structure -- Object Descriptor */
/****************************************************************/
typedef struct tagMQOD MQOD;
typedef MQOD MQPOINTER PMQOD;
typedef PMQOD MQPOINTER PPMQOD;
struct tagMQOD {
MQCHAR4 StrucId; /* Structure identifier */
MQLONG Version; /* Structure version number */
MQLONG ObjectType; /* Object type */
MQCHAR48 ObjectName; /* Object name */
MQCHAR48 ObjectQMgrName; /* Object queue manager name */
MQCHAR48 DynamicQName; /* Dynamic queue name */
MQCHAR12 AlternateUserId; /* Alternate user identifier */
/* Ver:1 */
MQLONG RecsPresent; /* Number of object records
present */
MQLONG KnownDestCount; /* Number of local queues opened
successfully */
MQLONG UnknownDestCount; /* Number of remote queues opened
successfully */
MQLONG InvalidDestCount; /* Number of queues that failed to
open */
MQLONG ObjectRecOffset; /* Offset of first object record
from start of MQOD */
MQLONG ResponseRecOffset; /* Offset of first response record
from start of MQOD */
MQPTR ObjectRecPtr; /* Address of first object record */
MQPTR ResponseRecPtr; /* Address of first response
record */
/* Ver:2 */
MQBYTE40 AlternateSecurityId; /* Alternate security identifier */
MQCHAR48 ResolvedQName; /* Resolved queue name */
MQCHAR48 ResolvedQMgrName; /* Resolved queue manager name */
/* Ver:3 */
MQCHARV ObjectString; /* Object long name */
MQCHARV SelectionString; /* Message Selector */
MQCHARV ResObjectString; /* Resolved long object name*/
MQLONG ResolvedType; /* Alias queue resolved object type */
/* Ver:4 */
};
#define MQOD_DEFAULT {MQOD_STRUC_ID_ARRAY},\
MQOD_VERSION_1,\
MQOT_Q,\
{""},\
{""},\
{"AMQ.*"},\
{""},\
0,\
0,\
0,\
0,\
0,\
0,\
NULL,\
NULL,\
{MQSID_NONE_ARRAY},\
{""},\
{""},\
{MQCHARV_DEFAULT},\
{MQCHARV_DEFAULT},\
{MQCHARV_DEFAULT},\
MQOT_NONE
モジュールがデフォルトを埋めて、ハッシュでオーバーライドできるようになっているのではないかと思います。もしそうなら、「DeviceName」は本当に正しいキーですか?WMQフィールド名または定数と一致すると思います。
更新:提供されたリンクの例によると、ハッシュキーは実際にcmqc.hのフィールド名と一致します。
更新#2はコメントに応答します:cmqc.hで定義されているオブジェクトタイプは次のとおりです。
/* Object Types */
#define MQOT_NONE 0
#define MQOT_Q 1
#define MQOT_NAMELIST 2
#define MQOT_PROCESS 3
#define MQOT_STORAGE_CLASS 4
#define MQOT_Q_MGR 5
#define MQOT_CHANNEL 6
#define MQOT_AUTH_INFO 7
#define MQOT_TOPIC 8
#define MQOT_CF_STRUC 10
#define MQOT_LISTENER 11
#define MQOT_SERVICE 12
#define MQOT_RESERVED_1 999
PHP、Perl、および他のほとんどの同様の取り組みについての私の理解は、それらがCAPIの非常に薄いラッパーであるということです。Perlは、ほとんどのコードをcmqc.hおよび他のCインクルードファイルから直接生成するだけなので、すべてのフィールド名とデフォルトはそれらのインクルードファイルと完全に一致します。このモジュールも同様のアプローチを取っているようで、必要に応じて定義された名前とフィールドのデフォルトを使用することを期待しています。
私は次のようなことを考えています:
$mqods = array(
'StrucID'=>'OD ',
'Version'=>1.
'ObjectType'=>1,
'ObjectName'=>'MYPUTQUEUE',
'ObjectQMgrName'=>'MYQUEUEMANAGER'
'DynamicQName'='',
'AlternateUserId'='',
'RecsPresent'=>0,
'KnownDestCount'=>0,
'UnknownDestCount'=>0,
'InvalidDestCount'=>0,
'ObjectRecOffset'=>0,
'ResponseRecOffset'=>0,
'ObjectRecPtr'=>NULL,
'ResponseRecPtr'=>NULL
);
アップデート#3は、追加のコメントに対応します。
Q MgrはMQODのすべてのバージョンを受け入れますが、そのレベルの機能にフォールバックします。v1を使用する場合は、それが機能することをテストできます。MQODの新しいバージョンを使用する場合は、ハッシュにフィールドを追加する必要があります。
2009年は「接続が壊れた」です。基本的に、QMgrは何かが気に入らず、接続を終了しました。通常、その戻りコードの意味のあるエラーメッセージはにあり/var/mqm/qmgrs/<qmgrname>/errors/AMQEER01.LOG
ます。