且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用IBM MQ-在Linux中的队列上备份和清除消息?

更新时间:2023-09-21 18:39:22

您可以使用类似于以下命令的命令来备份特定队列的详细信息(在此示例中为TEST.QUEUE).输出将同时包含DEFINE Q命令和SET AUTHREC命令,以恢复授予该特定队列的所有OAM权限.请注意,此命令不会为其他任何队列或通配权限备份OAM.

You can use a command similar to the following to backup the details of a specific queue (TEST.QUEUE in this example). The output will include both the DEFINE Q command along with SET AUTHREC commands to restore any OAM permissions granted to that specific queue. Note that this command will not backup OAM for any other queue or wild carded permissions.

dmpmqcfg -m qm.apple -n TEST.QUEUE -t queue -a -x all -o 1line

要备份队列中的数据,可以使用 MO03 SupportPac (又名QLOAD).由于该产品的v8已集成并重命名为dmpmqmsg,因此已撤回了IBM的SupportPac.对于v8之前的MQ版本,您仍然可以通过上面的链接下载MQ03 SupportPac.现在,SupportPac的原始作者还维护了一个名为 QLOAD 的程序版本.

To backup the data in the queue you can use the MO03 SupportPac (aka QLOAD) from IBM. This SupportPac from IBM has been withdrawn because at v8 of the product it was integrated and renamed to dmpmqmsg. For versions of MQ prior to v8 you can still download the MQ03 SupportPac at the above link. The original author of the SupportPac also now maintains a version of the program called QLOAD.

下面的示例命令将备份一个名为TEST.QUEUE的队列,而不会从队列中删除消息(将-i更改为大写-I还将其从队列中删除).

Example command below will backup a queue called TEST.QUEUE with out removing the messages from the queue (change the -i to capital -I to also remove them from the queue).

qload -m qm.apple -i TEST.QUEUE -f TEST.QUEUE.qload

输出将显示已读取和写入了多少条消息,示例输出如下:

Output will show how many messages were read and written, example output is below:

Read    - Files:   0  Messages:     3  Bytes:         4
Written - Files:   1  Messages:     3  Bytes:         4

下面的示例命令会将文件中的消息放回队列中.

Example command below will put the messages from the file back onto the queue.

qload -m qm.apple -f TEST.QUEUE.qload -o TEST.QUEUE