我继承了遗留系统,其中一部分在Unix机器上从MQ读取消息(SunOS 5.10 Generic_142901-13)
以下内容通过shell脚本执行:
$HOME/bin/mq -g1 -dN -q $QUEUE -m $QUEUE_MANAGER $HOME/bin/out/output.xml
注意:在这个阶段,我假设“mq”是提供的二进制文件,即不在内部写入。
问题:这个正在执行的mq命令是什么?这是IBM的事吗?
问题:我在哪里可以找到文档?
问题:“ - g1”,“ - dN”表示什么?
编辑:
bash-3.2$ file ./mq
./mq: ELF 32-bit LSB executable 80386 Version 1, dynamically linked, not stripped, no debugging information available
答案 0 :(得分:0)
...阿
bash-3.2$ less mq
"mq" may be a binary file. See it anyway?
当我查看二进制文件时,我会看到一些文档!我把他们包括在这里为下一个笨蛋:
Copyright (C) 2007
Computer Sciences Corporation
All rights reserved.
^@^@^@usage: mq -p[iaBDc] [-P#] [-dc] [-qQNAME] [-mQMGR] [E#] [-S# [-w#]] [T#]\
[-r[RQNAME]] [-R+options+RQNAME] [-xXQNAME] [-o[filename]]\
[filenames]
mq -g[#BDc] [-I#] [-L#] [-r#] [-dc] [-t] [-w#] [-qQNAME] [-mQMGR]\
[-xXQNAME] [-s[dirspec]|filename]
mq -b[#BDf] [-I#] [-L#] [-dc] [-w#] [-qQNAME] [-mQMGR] [-xXQNAME]\
[-s[dirspec]|filename]
mq -b[#BDi] [-I#] [-L#] [-dc] [-qQNAME] [-mQMGR] [-xXQNAME]\
[-s[dirspec]|filename]
mq -e[#riBD] process [-I#] [-L#] [-w#] [-qQNAME] [-mQMGR] [-xXQNAME]\
[-t] [-s[dirspec]|filename]
mq -n [-Dw#] [-qQNAME] [-mQMGR] [-xXQNAME]
mq -C[#Dc] [-I#] [-qQNAME] [-mQMGR] [-xXQNAME]
PUTs, GETs, BROWSEs, processes, and clears MQSeries(R) messages
*** WARNING: do not use a single instance of this utility to
put messages over a long period of time. Because
it is tied up trying to read a message, it can't
sense that the Queue Manager is quiescing, so the
Queue Manager cannot be stopped normally!
notes: - if filename is not specified, stdin is used as input,
or stdout is used for output
- errors are written to stderr
they can be appended '2>> file.log' for logging
- errors can also be written to MQ_EXCEPT if this is desired
- multiple GET or Browse messages will each be ended by line:
======= end of message =======
unless -d is specified
^@^@ - maximum message size is %d bytes
^@^@^@^@ Common options:
-D prints out debug info at every step.
-h prints this usage statement.
-mQM set the name of the queue manager to QM.
-qQ set the name of the put, get, browse, or inquire queue to Q.
-v prints version number of this utility to stdout.
-xQ puts error messages into queue Q.
PUT:
syntax:
mq -p[iaBDc] [-dc] [-qQNAME] [-mQMGR] [-P#] [E#] [-S[#] [-w#]]\
[T#] [-r[RQNAME]] [-R+options+RQNAME] [-xXQNAME]\
[-o[filename]] [filenames]
options:
-p PUT a message from stdin|filename to MQ_PUT
PUT multiple messages if -d is specified and -S is not.
a asks for message input, doesn't work with -S or -o options.
B binary PUT, the message descriptor Format is set to MQFMT_NONE.
c commit after each each message put. If messages are being
split then each message segment put is committed individually.
Committing split messages violates the transactional nature of
MQSeries, so use it only when extremely large messages are
being split.
dc defines the delimiter 'c' which separates messages in an
input stream:
'n' which is translated to newline,
'f' which is translated to formfeed,
and any other character is used directly as the delimiter.
The delimiter is not included as a part of a message.
If the -S and/or -o options are used, then this option defines
the delimiter on which the message is segmented. In this case
the delimiter is included as a part of the message and is the
last character in each message segment. A newline is the
delimiter for a split non-binary message.
E# message expires in # seconds, default is unlimited.
when expiry is set, messages are set to be NOT PERSISTENT.
I# PUT message(s) with message id = #.
i prints message id number to stdout after a successful put.
o the dequeued file will have the same name as the enqueued file
see option oF just below for mechanism details.
oF specifies the name of the file (F) into which the message
is dequeued from the receiving queue. This option causes two
or more messages to be sent, the first includes the name of the
file, the remaining messages are the contents of a split
message. Only relatively defined subdirectories are allowed,
no decending (../) subdirectories are allowed.
P# sets the message priority (# in 0-9), default priority is 5.
The defalut priority for a split message is 1, each message
segment of a split message has a priority one less than
the first segment of a split message.
R+ requests a report to be sent to MQ_REPLY or RQNAME if
specified.
reports can be a combination of:
EXCEPTION exception report
EXCEPTION_WITH_DATA with 100 bytes of msg
EXCEPTION_WITH_FULL_DATA with original msg
EXPIRATION message has expired
EXPIRATION_WITH_DATA with 100 bytes of msg
EXPIRATION_WITH_FULL_DATA with original msg
COA confirmation of arrival
COA_WITH_DATA with 100 bytes of msg
COA_WITH_FULL_DATA with original msg
COD confirmation of delivery
COD_WITH_DATA with 100 bytes of msg
COD_WITH_FULL_DATA with original msg
NEW_MSG_ID report gets a new MsgId (default)
PASS_MSG_ID report gets MsgId of msg
COPY_MSG_ID_TO_CORREL_ID report gets CorrelId from MsgId
PASS_CORREL_ID report gets CorrelId from msg
DEAD_LETTER_Q on error send original msg to DLQ
DISCARD_MSG on error discard the original msg
example: -R+COA+COD+EXCEPTION+QNAME_OF_REPLY_QUEUE
rQ PUT a REQUEST to MQ_REQUEST, expect reply on MQ_REPLY
or Q if r is followed by a Q name.
S# splits a very large message into ~1Meg segments and puts each
message segment as a separate message. # specifies the record
size if you have fixed length records. If record size is
specified then messages will be split on a multiple of the
record size. If a delimiter is specified, then messages will
be split just after a delimiter. If no delimiter is specified,
no record size is specified, and the message is not binary
then the message will be split after newlines. If the message
is binary and no record length is specified then the message
will be split at 1Meg intervals. You are not allowed to
specify both a delimiter and a record size.
The default priority of a split message is 0.
T# sets the message descriptor MsgType to #,
this is ignored when a -r (request) is specified.
w# is used to throttle putting extremely large messages,
it limits the flow to a 1Meg message every # seconds
for a maximum of 60 seconds.
GET:
syntax:
mq -g[#BDc] [-I#] [-L#] [-r#] [-dc] [-t] [-w#] [-qQNAME] [-mQMGR]\
[-xXQNAME] [-s[dirspec]|filename]
options:
-g GET message(s) from MQ_GET, print to filename|stdout.
# GET # messages from MQ_GET then quit.
B binary GET, no character conversion is done.
c commit after each each message received.
dc defines the delimiter 'c' placed between incoming messages:
'n' which is translated to newline,
'f' which is translated to formfeed,
'N' is translated to no delimiter between incoming messages,
and any other character is used directly as the delimiter.
I# GET message(s) with message id = #.
L# GET exactly # bytes, space fill if the message is shorter
than # bytes, otherwise truncate it.
-L0dN (displaying zero length with no delimiters) is a good
way to delete messages on a queue.
r# GET only one REPLY message from MQ_REPLY whose
correlation id is #, if # is not specified then
the correlation id is read from stdin.
s saves the message in a file whose name is the UTC date in
usecs, followed by .MsgType if the MsgType is not a SYSTEM
MsgType. dirspec is an optional directory specification
it must be adjacent to -s, not a separate argument
t use MQSeries' trigger data to determine GET queue
failed operations with a triggered queue disables
triggering of that queue.
w# set GET wait interval for GET to # seconds.
-w10 will cause mq to wait for 10 seconds for more messages,
-w-10 will cause mq to wait forever for incoming messages but
check every 10 seconds for a ^C interrupt.
BROWSE:
syntax:
mq -b[#BDf] [-I#] [-L#] [-dc] [-qQNAME] [-mQMGR] [-xXQNAME]\
[-s[dirspec]|filename]
options:
-b browse message(s) from MQ_BROWSE, print to filename|stdout,
browsing only looks at a snapshot of what is in the queue,
it is not designed to wait for more incoming messages.
# browse # messages from MQ_BROWSE then quit.
B binary BROWSE, no character conversion is done.
dc defines the delimiter 'c' placed between incoming messages:
'n' which is translated to newline,
'f' which is translated to formfeed,
'N' is translated to no delimiter between incoming messages,
and any other character is used directly as the delimiter.
f force a raw browse, split messages may not be displayed
in order.
I# browse message(s) with message id = #.
i print MQSeries header information, not the message.
L# browse exactly # bytes, space fill if the message is shorter
than # bytes, otherwise truncate it.
s saves the message in a file whose name is the UTC date in
usecs, followed by .MsgType if the MsgType is not a SYSTEM
MsgType. dirspec is an optional directory specification
it must be adjacent to -s, not a separate argument.
PROCESS:
syntax:
mq -e[#riBD] process [-I#] [-L#] [-w#] [-qQNAME] [-mQMGR]\
[-xXQNAME] [-t] [-s[dirspec]|filename]
options:
-e GET message(s) from MQ_GET, process them by executing the
process specified in the following command line argument.
The process is executed once for each message.
If a -s[dirspec] or filename is specified, the message is
saved to a file, and the process is called, otherwise the
process must accept the message from stdin, the message is
dequeued only if the process exits normally. The following
special characters in the process string will be replaced:
# in the process string will be replaced by the incoming
message's message id
= in the process string will be replaced by the incoming
message's correlation id
~ in the process string will be replaced by the incoming
message's MsgType
@ in the process string will be replaced by the filename
if -oFILENAME was specified when the file was put,
or if the -s[dirspec] or filename is specified on the
command line.
# quit after processing # messages.
B binary GET, no character conversion is done.
I# process message(s) with message id = #.
i print reply message id number to stdout (for logging).
r send executed process's stdout to the GET message's
ReplyToQmgr:ReplyToQ, process *must NOT* redirect to stdout.
t use MQSeries' trigger data to determine GET queue
process *must NOT* have a visible pipe (|).
failed operations with a triggered queue disables
triggering of that queue.
w# set GET wait interval for GET to # seconds.
-w10 will cause mq to wait for 10 seconds for more messages,
-w-10 will cause mq to wait forever for incoming messages but
check every 10 seconds for a ^C interrupt.
INQUIRE:
syntax:
mq -n [-D] [-w#] [-qQNAME] [-mQMGR] [-xXQNAME]
options:
-n print number of messages on MQ_INQUIRE to stdout.
w# will cause the -n to repeat every # seconds
output will be qmgr(if known),queue,UTC,curdepth
this will continue until the process is killed.
CLEAR:
syntax:
mq -C[#Dc] [-I#] [-qQNAME] [-mQMGR] [-xXQNAME]
options:
-C clear # message(s) from MQ_GET
# the number of messages to clear from the queue, if # is not
specified, then all of the messages are cleared.
c commits each message cleared, this can take a while, but
may have to be done if many messages need to be cleared
and you don't want to take the time to clear in lots of #.
I# clear message(s) with message id = #.
Environment variables:
export MQ_QMGR=queue_manager_name
the queue manager must be specified if it is not the default
queue manager.
export MQ_PUT=put_to_queue_name
export MQ_GET=get_from_queue_name
export MQ_BROWSE=browse_from_queue_name
export MQ_REQUEST=request_to_queue_name
export MQ_REPLY=get_reply_from_queue_name
export MQ_INQUIRE=inquire_of_queue_name
export MQ_EXCEPT=report_exception_to_queue_name
MQSeries is a registered trade mark of the IBM Corporation.
结算票