Author |
Message
|
jeasterl |
Posted: Tue Jan 19, 2010 9:25 am Post subject: Setting up a process on UNIX |
|
|
 Acolyte
Joined: 24 Jun 2001 Posts: 65
|
I have created a process called TEST_PROCESS on HP-UX. The process should use the Q program to create a message in a directory when the message arrives on a queue. Below is the definition of the process:
AMQ8407: Display Process details.
DESCR( )
APPLICID(/home/USER/tools/q -m AURORA -I SYSTEM.DEFAULT.LOCAL.QUEUE -F /home/USER/tools/test_out)
USERDATA( ) ENVRDATA(&)
PROCESS(TEST_PROCESS) ALTDATE(2010-01-19)
ALTTIME(10.58.42) APPLTYPE(UNIX)
I have confirmed that the string supplied in the APPLICID works by running it from the command line. However, when I attempt to run this via triggering, here is what I get:
__________________________________________________
Waiting for a trigger message
/home/USER/tools/q -m AURORA -I SYSTEM.DEFAULT.LOCAL.QUEUE -F /home/USER/tools/test_out 'TMC 2TRIGGER_QUEUE TEST_PROC
ESS
/home/USER/tools/q -m AURORA -I SYSTEM.DEFAULT.LOC
AL.QUEUE -F /home/USER/tools/test_out
cfirst.qm
'
MQSeries Q Program by Paul Clarke [ V5.0.0 Build:Jul 16 2008 ]
(c) Copyright IBM Corp. 1995, 2008
Usage: Q <Optional flags as below>
[-a[dnpqcRrstfFaAcD] Message attributes
p:Persistent,n:Non-Persisent,q:Persistence as Q,s:Allow Segmentation
c:complete message,d:Datagram,R:Request,r:Reply,t:Report
f:Async put, F:no async put
a:Read Ahead, A:No Read Ahead
C:Close Quiesce, D:Close Delete
2:Force message properties as MQRFH2s
[-A[i|o|a]<value> Application Identity|Origin Data|Acct Token
(c) [-b Browse input Q (DEP:use i rather than I]
[-cCCSid[:X'Encoding'] Convert]
[-C[a][i][A][I] Context]
a: pass all context i: pass identity context
A: set all context I: set identity context
n: no context
(c) [-d[h][f][n][w<width>][1][2][3] Display Detail
h:Print message in hex n:Don't print message
d/D:Print out MQMD o/O:Print out MQOD
More <Press Enter>...
Any help would be greatly appreciated! |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jan 19, 2010 9:32 am Post subject: Re: Setting up a process on UNIX |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
jeasterl wrote: |
Any help would be greatly appreciated! |
I suspect the q program is trying to interpret the trigger header as an additional parameter. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
bruce2359 |
Posted: Tue Jan 19, 2010 10:22 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Quote: |
APPLICID(/home/USER/tools/q -m AURORA -I SYSTEM.DEFAULT.LOCAL.QUEUE -F /home/USER/tools/test_out)
USERDATA( ) ENVRDATA(&) |
Hmmm.
If you are using the supplied trigger monitor, I suspect you need to pass parameters via USERDATA and the & via ENVRDATA. Try this:
[edit]
APPLICID('/home/USER/tools/q') +
APPLTYPE(UNIX) +
USERDATA(' -m AURORA -I SYSTEM.DEFAULT.LOCAL.QUEUE -F /home/USER/tools/test_out') +
ENVRDATA(' &')
Note the space before the &. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
jeasterl |
Posted: Tue Jan 19, 2010 12:34 pm Post subject: |
|
|
 Acolyte
Joined: 24 Jun 2001 Posts: 65
|
Still nothing
Waiting for a trigger message
/home/USER/tools/q 'TMC 2TRIGGER_QUEUE
EST_PROCESS
/home/USER/tools/q
-m AURORA -I SYSTEM.DEFAULT.
OCAL.QUEUE -F /home/USER/tools/test_out
cfirst.qm
' -m AURORA -I SYSTEM.DEFAULT.LOCAL.QUEUE -F
/home/USER/tools/test_out
MQSeries Q Program by Paul Clarke [ V5.0.0 Build:Jul 16 2008 ]
(c) Copyright IBM Corp. 1995, 2008
Usage: Q <Optional flags as below>
[-a[dnpqcRrstfFaAcD] Message attributes
p:Persistent,n:Non-Persisent,q:Persistence as Q,s:Allow Segmentation
c:complete message,d:Datagram,R:Request,r:Reply,t:Report
f:Async put, F:no async put
a:Read Ahead, A:No Read Ahead
C:Close Quiesce, D:Close Delete
2:Force message properties as MQRFH2s
[-A[i|o|a]<value> Application Identity|Origin Data|Acct Token
(c) [-b Browse input Q (DEP:use i rather than I]
[-cCCSid[:X'Encoding'] Convert]
[-C[a][i][A][I] Context]
a: pass all context i: pass identity context
A: set all context I: set identity context
n: no context
(c) [-d[h][f][n][w<width>][1][2][3] Display Detail
h:Print message in hex n:Don't print message
d/D:Print out MQMD o/O:Print out MQOD
More <Press Enter>... |
|
Back to top |
|
 |
bruce2359 |
Posted: Tue Jan 19, 2010 12:49 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Display the local application queue definition attributes. Paste here.
Display the initiation queue local definition attributes. Paste here.
Stop the existing trigger monitor; then start a trigger monitor in a shell. Copy/paste the command you use to start it, and the response from the trigger monitor. Paste here. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Jan 19, 2010 12:53 pm Post subject: Re: Setting up a process on UNIX |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Vitor wrote: |
jeasterl wrote: |
Any help would be greatly appreciated! |
I suspect the q program is trying to interpret the trigger header as an additional parameter. |
 |
|
Back to top |
|
 |
zonko |
Posted: Tue Jan 19, 2010 11:02 pm Post subject: |
|
|
Voyager
Joined: 04 Nov 2009 Posts: 78
|
I also agree. A triggered app has to be able to handle the TMC structure passed to it on the command line. |
|
Back to top |
|
 |
jeasterl |
Posted: Wed Jan 20, 2010 1:47 pm Post subject: |
|
|
 Acolyte
Joined: 24 Jun 2001 Posts: 65
|
Application Queue:
1 : dis ql(TRIGGER_QUEUE)
AMQ8409: Display Queue details.
DESCR( ) PROCESS(TEST_PROCESS)
BOQNAME( ) INITQ(CFIRST.INITQ)
TRIGDATA( ) CLUSTER( )
CLUSNL( ) QUEUE(TRIGGER_QUEUE)
CRDATE(2010-01-12) CRTIME(13.38.41)
ALTDATE(2010-01-19) ALTTIME(09.33.2
GET(ENABLED) PUT(ENABLED)
DEFPRTY(0) DEFPSIST(NO)
MAXDEPTH(5000) MAXMSGL(4194304)
BOTHRESH(0) SHARE
DEFSOPT(SHARED) HARDENBO
MSGDLVSQ(PRIORITY) RETINTVL(999999999)
USAGE(NORMAL) TRIGGER
TRIGTYPE(FIRST) TRIGDPTH(1)
TRIGMPRI(0) QDEPTHHI(80)
QDEPTHLO(20) QDPMAXEV(ENABLED)
QDPHIEV(DISABLED) QDPLOEV(DISABLED)
QSVCINT(999999999) QSVCIEV(NONE)
DISTL(NO) DEFTYPE(PREDEFINED)
TYPE(QLOCAL) SCOPE(QMGR)
DEFBIND(OPEN) IPPROCS(0)
OPPROCS(0) CURDEPTH(1)
Initiation Queue:
2 : dis ql(CFIRST.INITQ)
AMQ8409: Display Queue details.
DESCR( ) PROCESS( )
BOQNAME( ) INITQ( )
TRIGDATA( ) CLUSTER( )
CLUSNL( ) QUEUE(CFIRST.INITQ)
CRDATE(2010-01-12) CRTIME(14.23.14)
ALTDATE(2010-01-12) ALTTIME(14.23.14)
GET(ENABLED) PUT(ENABLED)
DEFPRTY(0) DEFPSIST(NO)
MAXDEPTH(5000) MAXMSGL(4194304)
BOTHRESH(0) SHARE
DEFSOPT(SHARED) HARDENBO
MSGDLVSQ(PRIORITY) RETINTVL(999999999)
USAGE(NORMAL) NOTRIGGER
TRIGTYPE(FIRST) TRIGDPTH(1)
TRIGMPRI(0) QDEPTHHI(80)
QDEPTHLO(20) QDPMAXEV(ENABLED)
QDPHIEV(DISABLED) QDPLOEV(DISABLED)
QSVCINT(999999999) QSVCIEV(NONE)
DISTL(NO) DEFTYPE(PREDEFINED)
TYPE(QLOCAL) SCOPE(QMGR)
DEFBIND(OPEN) IPPROCS(1)
OPPROCS(0) CURDEPTH(0)
Command to start the trigger monitor:
USER@themis:/home/USER/tools-$ runmqtrm -m cfirst.qm -q CFIRST.INITQ
Response from trigger monitor:
__________________________________________________
Waiting for a trigger message
/home/jeaster/tools/q 'TMC 2TRIGGER_QUEUE T
EST_PROCESS
/home/jeaster/tools/q
-m AURORA -I SYSTEM.DEFAULT.L
OCAL.QUEUE -F /home/jeaster/tools/test_out
cfirst.qm
' -m AURORA -I SYSTEM.DEFAULT.LOCAL.QUEUE -F
/home/jeaster/tools/test_out
MQSeries Q Program by Paul Clarke [ V5.0.0 Build:Jul 16 2008 ]
(c) Copyright IBM Corp. 1995, 2008
Usage: Q <Optional flags as below>
[-a[dnpqcRrstfFaAcD] Message attributes
p:Persistent,n:Non-Persisent,q:Persistence as Q,s:Allow Segmentation
c:complete message,d:Datagram,R:Request,r:Reply,t:Report
f:Async put, F:no async put
a:Read Ahead, A:No Read Ahead
C:Close Quiesce, D:Close Delete
2:Force message properties as MQRFH2s
[-A[i|o|a]<value> Application Identity|Origin Data|Acct Token
(c) [-b Browse input Q (DEP:use i rather than I]
[-cCCSid[:X'Encoding'] Convert]
[-C[a][i][A][I] Context]
a: pass all context i: pass identity context
A: set all context I: set identity context
n: no context
(c) [-d[h][f][n][w<width>][1][2][3] Display Detail
h:Print message in hex n:Don't print message
d/D:Print out MQMD o/O:Print out MQOD
More <Press Enter>...
p/P:Print out MQPMO g/G:Print out MQGMO
s/S:Print out MQSD r/R:Print out MQSRO
x:Use XML Shortform X:No XML Auto detect
l:Print message length f:Format recognised messages
1:Low level of detail 2:Medium level of detail
3:High level of detail
[-e Echo to Reply Queue]
[-E Echo to Reply Queue and set Reply QMgr]
[-f Input file] Each line is one message
[-F Load/Unload file] Entire file for one message
[-X Load a file in hex as one message
[-g[p][x][C][m|c|g]identifier Get or Put by identifier
x:ID is in hex p:Put with ID C:Use MQCI New session
m:Message ID c:Correlation ID g:Group ID
[-h Filter string]
[-H Selection string]
(c) [-i Input Queue (browse)]
(c) [-I Input Queue (get)]
[-j Specify format name ] [-k Browse Lock]
[-L Message Limit] Maximum number of messages to process
[-m LocalQueueManager] [-M Simple text message]
More <Press Enter>...
[-n"Confirm options" below :-
[ca|cad|cafd] [cd|cdd|cdfd] [e|ed|efd] [x|xd|xfd]
[pan][nan][newm][passm][copym][disc][passd][act]
(c) {-o Output Queue} Multiple use uses distribution list
{-O Output Queue} Bind on Open version of above
[-p Commit interval] [-P Message Priority]
[-q Quiet....don't write messages to screen
[-r[+] Reply Queue] [-s Force msg output to stdout]
[-$ Queue Separator character]
[-t Print timings
[-U[+] User Identifier [+]: Alternate Userid
[-v[p|P|1|2|3|4|5] Verbose Level
p: Pause, P: Cmd line parms >=1: Message info,>=2: API info]
[-V[z][c] Return value, default MQRC]
z:Force zero return c:MQCC mapped to 0,4,8
(c) [-w Wait for messages (in seconds)]
[-W Sleep before issuing MQGET (in milliseconds)]
[-x[f][s][i][b|n][c][q][N][t][u] Use MQCONNX]
f:Fast binding s:Standard binding i:Isolated
b:Shared Blocking Connection n:Shared Nonblocking Connection
c:Specify channel on MQCONNX
More <Press Enter>...
q:No fail if quiescing N:No MQDISC
t:Specify connection tag on MQCONNX
u:Specify User ID and Password MQCONNX
[-y Expire time in 1/10th's second
[-z Zero out MsgId before MQPUT
[-Z TimeZone (hours) Put Date/Time
[-1 Use MQPUT1 rather than MQPUT
[-# Structure versions] eg. #m1p2g2o1x4 or #c for current
[-* Repeat execution]
[-=[n] Set Max Msg Length - 'n' will not truncate]
[-! Do not use exithandler]
[-S[o:TopicObject] Subscribe to Topic Object
[ [s:TopicString] Subscribe to Topic String
[ [n:SubName] Subscription Name
[ [u:SubUserData] Subscription User Data
[ [l SubLevel] Subscription Level
[ [c][r][a] [d][v][f][g] [N][R] [C][T]
c:Create (def) r:Resume a:Alter subscription
d:Durable
v:Any User f:Fixed User g:Group Sub
N:New pubs only R:Pubs on request
More <Press Enter>...
C:Wildcard Char T:Wildcard Topic
D:Delete durable sub
[-T[o:TopicObject] Publish to Topic Object
[ [s:TopicString] Publish to Topic String
[ [r][p][n]
r:Retain p:Supress ReplyTo
n:Not own Subs
Common options marked with (c)
Examples
--------
Write to a queue : q -oQ1
Write to two queues (Dist list) : q -oQ1 -oQ2
Write to a queue on remote Qmgr : q -oQM2/Q1
Read from a queue : q -IQ1
Browse from a queue : q -iQ1
Show Message Descriptor : q -iQ1 -dd3
Wait for messages : q -IQ1 -w60
Move messages between Queues : q -IQ1 -oQ2
Copy messages between Queues : q -iQ1 -oQ2
More <Press Enter>...
Subscribe to a topic : q -Ss:TopicStr -w60
Make a durable subscription : q -Sds:TopicStr -Sn:MySubName -w60
Publish on a topic : q -Ts:TopicStr
End of application trigger.
__________________________________________________
Waiting for a trigger message |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jan 20, 2010 1:51 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Was this last post supposed to add anything to the discussion? It was already clear that the app was being triggered so your queue definintions were correct. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
bruce2359 |
Posted: Wed Jan 20, 2010 2:12 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Display your PROCESS object attributes. Post here. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jan 20, 2010 2:21 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
bruce2359 wrote: |
Display your PROCESS object attributes. Post here. |
I remain unconvinced this will add to the situation.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
zonko |
Posted: Wed Jan 20, 2010 10:26 pm Post subject: |
|
|
Voyager
Joined: 04 Nov 2009 Posts: 78
|
The above posts by vitor, mqjeff and me have already given the reason for the issue, that the q program cannot handle the TMC structure passed to it on the command line.
The OP should write either a script or a stub app to strip the first argument from the command line and then pass the remaining arguments to the q program. |
|
Back to top |
|
 |
jeasterl |
Posted: Thu Jan 21, 2010 6:52 am Post subject: |
|
|
 Acolyte
Joined: 24 Jun 2001 Posts: 65
|
Couple of dumb questions here:
1) what is the TMC
2) Does anyone have any example of how I would strip out the parameters that the trigger monitor is upset about so I can get it what it needs to trigger off the q program? |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jan 21, 2010 7:09 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
jeasterl wrote: |
1) what is the TMC |
It's the header, described in the Application Programming documentation, that's passed to the triggered process so it knows why it was triggered. For instance, which queue the triggering message arrives on. Not all applications use it of course (your design could specify that if this process has started, it must be because of a message on queue X) but they all get passed it
jeasterl wrote: |
2) Does anyone have any example of how I would strip out the parameters that the trigger monitor is upset about so I can get it what it needs to trigger off the q program? |
You could write an intermediate application (as suggested above) which reads the trigger message, reformats it and calls the q application. But if you were doing that you'd be better off writing your own trigger monitor that doesn't supply the header in the first place (seen that done on a couple of sites, but mostly because they needed additional functionality in the trigger monitor for other reasons).
Or write a triggerable application that does what you're trying to finagle q into doing. I'd say that was easiest IMHO.
Bottom line - as designed, the q program is intended to be manually started from a command line not triggered. So it's down to your good judgement how much dancing round you want to do to get this to work. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|