Sync
This is a flag to indicate that the Syncpoint option is to be used, and the message(s) not committed to the queue until an MQBACK, MQCOMM or MQDISC call is made. These are both wrapped with the queue manager Backout(), Commit() and Disconnect() methods respectively.
The value is simply interpreted as true or false.
If the Sync option is combined with the PutMsgOpts option, the Options field in the PutMsgOpts is checked for compatibility. If the Sync flag is true and the PutMsgOpts specifies MQseries::MQPMO_NO_SYNCPOINT, or vice versa, a fatal error is raised. If no conflict exists, the Sync flag amends the PutMsgOpts.
$queue->
Get(Message => $getmessage,
Sync => 1,
) or die("Unable to get message
" .
"CompCode = " . $queue->CompCode() . "
" .
"Reason = " . $queue->Reason() . "
");
print "第一条消息:===";
print $getmessage->Data();
print "
";
# $qmgr_obj->Commit();
这是一个标志表明 Syncpoint 选项被使用,消息不会提交到队列直到一个
MQBACK, MQCOMM or MQDISC 调用被请求。
那些都被封装为Backout(), Commit() and Disconnect() methods
这个值是简单的解释为true或者false