Author |
Message
|
scravr |
Posted: Fri Jan 02, 2009 8:13 am Post subject: broker schema |
|
|
 Partisan
Joined: 03 Apr 2003 Posts: 391 Location: NY NY USA 10021
|
I have 4 Flows with about 12 compute nodes. These nodes have generic functions/procs for string manipulation, element parsing, etc.
To reduce debug and maintenance, I created under FlowA a new broker schema with esql file, and then moved all generic funcs in there. Few generic function need InputRoot and OutputRoot.
Also moved CopyMessageHeaders() and CopyEntireMessage() (from these compute nodes) into broker schema esql file.
When deploy a bar file with these 4 flows, I get errors InputRoot and OutputRoot are node valid. Not in scope.
1. How can I make Input/Output roots global?
2. How can I create reference to Input/Output roots and pass to funcs/procs. What type of parameter are these for the functions prototype? ROW?
3. Is all these make sense? |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Jan 02, 2009 8:30 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
There's a change in behavior in this area between versions.
What version of Broker are you using? |
|
Back to top |
|
 |
scravr |
Posted: Fri Jan 02, 2009 8:50 am Post subject: broker schema |
|
|
 Partisan
Joined: 03 Apr 2003 Posts: 391 Location: NY NY USA 10021
|
broker 6.1
toolkit Version: 6.1.0.3 |
|
Back to top |
|
 |
mgk |
Posted: Fri Jan 02, 2009 9:21 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
You can pass InputRoot/OutputRoot etc to functions/procedures as REFERENCE variables. Be aware that a REFERENCE to OutputRoot does not behave exactly the same as OutputRoot itself. Search for a very old post from me on this forum for a description of the differences if you want to know what they are.
Kind regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
scravr |
Posted: Fri Jan 02, 2009 9:53 am Post subject: broker schema |
|
|
 Partisan
Joined: 03 Apr 2003 Posts: 391 Location: NY NY USA 10021
|
HI MGK,
What type of parameter a func/proc should specify for InputRoot and OutputRoot?
a ROW IN/OUT parameter did not work. |
|
Back to top |
|
 |
mgk |
Posted: Fri Jan 02, 2009 10:15 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
As I said above, REFERENCE. _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
scravr |
Posted: Fri Jan 02, 2009 1:21 pm Post subject: broker schema |
|
|
 Partisan
Joined: 03 Apr 2003 Posts: 391 Location: NY NY USA 10021
|
I have GenericErrorRoutine that is called (when error occur) from multiple flows.
The flows are triggered by diff InputQs (diff msg set/format/type)
The generic error routine put some-error-text to some-ErrorQ and then Inhibit GET from Original InputQ.
the following asbitstream is failing sine the MQPCF msg could not be parsed as
OutputRoot.Properties.MessageSet/MessageType/MessageFormat.
Any ideas how to change Properties to MQPCF (or to some default values) ?
CREATE COMPUTE MODULE ERROR_FLOW_InhibitGet
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
-- PCF command to inhibit GET's from input queue.
CALL CopyMessageHeaders();
SET OutputRoot.Properties.Encoding = 546;
SET OutputRoot.MQMD.MsgType = MQMT_REQUEST;
SET OutputRoot.MQMD.Format = MQFMT_ADMIN;
SET OutputRoot.MQMD.ReplyToQ = 'Error001';
SET OutputRoot.MQMD.MsgSeqNumber = 1;
/* Command is 'Change Queue: Inhibit GET from queue'. */
CREATE FIELD OutputRoot.MQPCF;
DECLARE PcfQ REFERENCE TO OutputRoot.MQPCF;
SET PcfQ.Type = MQCFT_COMMAND;
SET PcfQ.StrucLength = 36; -- MQCFH_STRUC_LENGTH;
SET PcfQ.Version = MQCFH_CURRENT_VERSION;
SET PcfQ.Command = MQCMD_CHANGE_Q;
SET PcfQ.MsgSeqNumber = 1;
SET PcfQ.Control = MQCFC_LAST;
/* First parameter: Queue Name. */
SET PcfQ.Parameter[1] = MQCA_Q_NAME;
SET PcfQ.Parameter[1].* =InputRoot.MQMD.SourceQueue;
/* Second parameter: Queue Type. */
SET PcfQ.Parameter[2] = MQIA_Q_TYPE;
SET PcfQ.Parameter[2].* = MQQT_LOCAL;
/* Third parameter: Allow/Inhibit GET.*/
SET PcfQ.Parameter[3] = MQIA_INHIBIT_GET;
SET PcfQ.Parameter[3].* = MQQA_GET_INHIBITED;
set OutputRoot.BLOB.BLOB = asbitstream(OutputRoot.MQPCF);
set OutputRoot.MQPCF = null;
set OutputRoot.MQRFH2 = null;
SET OutputRoot.MQMD.Format = MQFMT_ADMIN;
RETURN TRUE;
END;
This Msg is/should going out to SYSTEM.ADMIN.COMMAND.QUEUE |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jan 02, 2009 2:29 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Well if your OutputRoot is being passed by reference, you declared the MQPCF node without a parser. You should have added DOMAIN 'MQPCF' to your create command...
[edit]I stand corrected it seems that the right domain name is 'MQADMIN' [/edit] _________________ MQ & Broker admin
Last edited by fjb_saper on Fri Jan 02, 2009 3:03 pm; edited 1 time in total |
|
Back to top |
|
 |
rekarm01 |
Posted: Fri Jan 02, 2009 2:38 pm Post subject: Re: broker schema |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
scravr wrote: |
the following asbitstream is failing sine the MQPCF msg could not be parsed as
OutputRoot.Properties.MessageSet/MessageType/MessageFormat.
Any ideas how to change Properties to MQPCF (or to some default values)? |
Try specifying the message domain when creating the MQPCF header, with something like:
Code: |
CREATE NEXTSIBLING OF OutputRoot.MQMD DOMAIN 'MQADMIN' NAME 'MQPCF';
CREATE FIELD OutputRoot.MQPCF; |
Assuming ASBITSTREAM() is needed, it may need additional arguments. For example:
Code: |
SET OutputRoot.BLOB.BLOB = ASBITSTREAM(OutputRoot.MQPCF OPTIONS EmbeddedBitStream); |
|
|
Back to top |
|
 |
scravr |
Posted: Mon Jan 05, 2009 8:16 am Post subject: broker schema |
|
|
 Partisan
Joined: 03 Apr 2003 Posts: 391 Location: NY NY USA 10021
|
The ASBITSTREAM still fail as it parses the OutputRoot.MQPCF as the original input-msg set/format/type.
I try it with EmbeddedBitStream, FolderBitStream and RootBitStream -nothing helps.
How do I force it to parse as a new MQPCF msg ?
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
-- PCF command to inhibit GET's from input queue.
CALL CopyMessageHeaders();
--SET OutputRoot.MQMD.Encoding = 546; -- need remember 273 is unix
SET OutputRoot.Properties.Encoding = 546;
SET OutputRoot.MQMD.MsgType = MQMT_REQUEST;
SET OutputRoot.MQMD.Format = MQFMT_ADMIN;
SET OutputRoot.MQMD.ReplyToQ = 'Error001'; -- mq admin monitor q-name
SET OutputRoot.MQMD.MsgSeqNumber = 1;
/* Command is 'Change Queue: Inhibit GET from queue'. */
CREATE NEXTSIBLING OF OutputRoot.MQMD DOMAIN 'MQADMIN' NAME 'MQPCF'; -- new
CREATE FIELD OutputRoot.MQPCF;
DECLARE PcfQ REFERENCE TO OutputRoot.MQPCF;
SET PcfQ.Type = MQCFT_COMMAND;
SET PcfQ.StrucLength = 36; -- MQCFH_STRUC_LENGTH;
SET PcfQ.Version = MQCFH_CURRENT_VERSION;
SET PcfQ.Command = MQCMD_CHANGE_Q;
SET PcfQ.MsgSeqNumber = 1;
SET PcfQ.Control = MQCFC_LAST;
/* First parameter: Queue Name. */
SET PcfQ.Parameter[1] = MQCA_Q_NAME;
SET PcfQ.Parameter[1].* =InputRoot.MQMD.SourceQueue;
/* Second parameter: Queue Type. */
SET PcfQ.Parameter[2] = MQIA_Q_TYPE;
SET PcfQ.Parameter[2].* = MQQT_LOCAL;
/* Third parameter: Allow/Inhibit GET.*/
SET PcfQ.Parameter[3] = MQIA_INHIBIT_GET;
SET PcfQ.Parameter[3].* = MQQA_GET_INHIBITED;
-- SET refRequest.Parameter[3] = MQCA_Q_DESC;
-- SET refRequest.Parameter[3].* = 'Q is GET inhibit';
SET OutputRoot.BLOB.BLOB = ASBITSTREAM(OutputRoot.MQPCF, InputRoot.Properties.Encoding,
InputRoot.Properties.CodedCharSetId,,,,EmbeddedBitStream); --FolderBitStream); RootBitStream
-- SET OutputRoot.BLOB.BLOB = ASBITSTREAM(OutputRoot.MQPCF OPTIONS EmbeddedBitStream); -- new
-- set OutputRoot.BLOB.BLOB = asbitstream(OutputRoot.MQPCF);
set OutputRoot.MQPCF = null;
set OutputRoot.MQRFH2 = null;
-- SET OutputRoot.MQMD.Format = MQFMT_ADMIN;
RETURN TRUE;
END; |
|
Back to top |
|
 |
scravr |
Posted: Mon Jan 05, 2009 9:53 am Post subject: |
|
|
 Partisan
Joined: 03 Apr 2003 Posts: 391 Location: NY NY USA 10021
|
It looks like error is on the OutputRoot.MQPCF.StrucLength.
How do I calculate this length? |
|
Back to top |
|
 |
scravr |
Posted: Mon Jan 05, 2009 12:40 pm Post subject: broker schema |
|
|
 Partisan
Joined: 03 Apr 2003 Posts: 391 Location: NY NY USA 10021
|
No success with esql.
does anyone have java-compute node sample of inhibit get? |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Jan 05, 2009 1:11 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
scravr wrote: |
It looks like error is on the OutputRoot.MQPCF.StrucLength.
How do I calculate this length? |
Read the manual. My guess is there is an alignment that you are missing that needs to be added to the length... The admin and pcf manuals should provide you with an algorythm to calculate the length.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mymq |
Posted: Thu Jun 18, 2009 8:29 pm Post subject: |
|
|
Centurion
Joined: 01 Mar 2007 Posts: 101 Location: US-Greenwille
|
Hi,
Did u get any update on this issue? _________________ --SRK-- |
|
Back to top |
|
 |
sunny_30 |
Posted: Sun Jul 31, 2011 10:18 pm Post subject: |
|
|
 Master
Joined: 03 Oct 2005 Posts: 258
|
Hi Scravr
Could you please let me know if you found a resolution to this issue ?
The same esql (as you posted) is currently working in our MB6 environment to get-inhibit the MQ queue but fails to work in MB7 environment.
The PCF message which is sent to SYSTEM.ADMIN.COMMAND.QUEUE lands up in DLQ with following error:
3023 0x00000bcf MQRCCF_MD_FORMAT_ERROR
Note: Before outputting to COMMAND queue, the MQPCF header is converted to BLOB, later set to NULL the exact same way as you implemented in above esql.
If I try removing the BLOB conversion, & keep the MQPCF header to output, with MQMD format set to MQFMT_ADMIN.. I get a different exception:
"Unrecognised parameter type in PCF message"
for MQMD encoding (value 546)
Please help
Thanks |
|
Back to top |
|
 |
|