Author |
Message
|
JosephGramig |
Posted: Mon Feb 25, 2008 10:09 am Post subject: |
|
|
 Grand Master
Joined: 09 Feb 2006 Posts: 1244 Location: Gold Coast of Florida, USA
|
I have been testing on my Laptop (Windows XP) with both WMB 6.0 and WMB 6.1. _________________ Joseph
Administrator - IBM WebSphere MQ (WMQ) V6.0, IBM WebSphere Message Broker (WMB) V6.1 & V6.0
Solution Designer - WMQ V6.0
Solution Developer - WMB V6.1 & V6.0, WMQ V5.3 |
|
Back to top |
|
 |
JosephGramig |
Posted: Fri May 16, 2008 5:06 am Post subject: |
|
|
 Grand Master
Joined: 09 Feb 2006 Posts: 1244 Location: Gold Coast of Florida, USA
|
Here is an alternate solution that should work for V6.0 and V6.1 of broker. In a Java Compute Node (JCN):
Code: |
public class TEST_STOP_ME_StopThisFlow extends MbJavaComputeNode {
public void evaluate(MbMessageAssembly contact admin) throws MbException {
MbOutputTerminal out = getOutputTerminal("out");
//MbOutputTerminal alt = getOutputTerminal("alternate");
MbMessage inMessage = contact admin.getMessage();
// create new message
MbMessage outMessage = new MbMessage(inMessage);
MbMessageAssembly outAssembly = new MbMessageAssembly(contact admin,
outMessage);
try {
// ----------------------------------------------------------
// Add user code below
// Get the DNS name and port number of the CM
String configMgrDnsName = (String)getUserDefinedAttribute("CM_DNS_NAME");
int port = ((Integer)getUserDefinedAttribute("CM_PORT")).intValue();
// Stop the message flow...
ConfigManagerConnectionParameters cmcp =
new MQConfigManagerConnectionParameters(configMgrDnsName, port, getBroker().getQueueManagerName());
ConfigManagerProxy cmp = ConfigManagerProxy.getInstance(cmcp);
TopologyProxy t = cmp.getTopology();
BrokerProxy b = t.getBrokerByName(getBroker().getName());
ExecutionGroupProxy e = b.getExecutionGroupByName(getExecutionGroup().getName());
MessageFlowProxy m = e.getMessageFlowByName(getMessageFlow().getName());
m.stop(true);
cmp.disconnect();
// End of user code
// ----------------------------------------------------------
// The following should only be changed
// if not propagating message to the 'out' terminal
out.propagate(outAssembly);
} catch(ConfigManagerProxyException ex1) {
// eat it
System.out.println("Configuration Manager is NOT available"+ " because "+ex1);
//MbService.logError("", "", "", "", "", this);
} finally {
// clear the outMessage
outMessage.clearMessage();
}
}
}
|
Note that I pass the DNS name and port number in as values in the BAR file. While this code is fairly simple, I do assume that you understand what I did before and after this node or that you will make up what you want to do before and after the node...
While this is a better way to solve the problem (imho), the problem still exists and if you were trying to do something MQ specific, then it would be a problem still for you. |
|
Back to top |
|
 |
JosephGramig |
Posted: Fri May 23, 2008 4:31 am Post subject: |
|
|
 Grand Master
Joined: 09 Feb 2006 Posts: 1244 Location: Gold Coast of Florida, USA
|
One more try at posting this...
Here is code for modifying WMQ 6.0 objects from WMB V6.1:
Code: |
CREATE NEXTSIBLING OF OutputRoot.Properties DOMAIN 'MQMD';
CREATE NEXTSIBLING OF OutputRoot.MQMD DOMAIN 'MQADMIN' NAME 'MQPCF';
CREATE FIELD OutputRoot.MQPCF;
SET OutputRoot.MQMD.MsgType = MQMT_REQUEST;
Set OutputRoot.MQMD.ReplyToQ = 'TEST.OUT';
DECLARE refRequest REFERENCE TO OutputRoot.MQPCF;
SET refRequest.Type = 16; --MQCFT_COMMAND_XR z/OS
SET refRequest.Version = 3; -- required for z/OS
Set refRequest.Command = MQCMD_CHANGE_Q;
SET refRequest.MsgSeqNumber = 1;
SET refRequest.Control = MQCFC_LAST;
SET refRequest.Parameter[1] = MQCA_Q_NAME;
SET refRequest.Parameter[1].* = 'TEST.IN';
SET refRequest.Parameter[2] = MQIA_Q_TYPE;
SET refRequest.Parameter[2].* = MQQT_LOCAL;
/* Third parameter: Allow/Inhibit GET.*/
SET refRequest.Parameter[3] = MQIA_INHIBIT_GET;
SET refRequest.Parameter[3].* = MQQA_GET_INHIBITED;
|
This works in V6.1. |
|
Back to top |
|
 |
francoisvdm |
Posted: Mon May 26, 2008 4:28 am Post subject: |
|
|
Partisan
Joined: 09 Aug 2001 Posts: 332
|
V6.0.2 on Windows
The following code will return all attributes about a queue called "TEST2".
Code: |
CALL CopyMessageHeaders();
SET OutputRoot.Properties.Encoding = 546;
SET OutputRoot.MQMD.MsgType = MQMT_REQUEST;
SET OutputRoot.MQMD.Format = MQFMT_ADMIN;
SET OutputRoot.MQMD.ReplyToQ = 'PCF_OUT';
SET OutputRoot.MQMD.MsgSeqNumber = 1;
CREATE FIELD OutputRoot.MQPCF;
DECLARE refRequest REFERENCE TO OutputRoot.MQPCF;
SET refRequest.Type = MQCFT_COMMAND;
SET refRequest.StrucLength = MQCFH_STRUC_LENGTH;
SET refRequest.Version = MQCFH_CURRENT_VERSION;
SET refRequest.Command = MQCMD_INQUIRE_Q;
SET refRequest.MsgSeqNumber = 1;
SET refRequest.Control = MQCFC_LAST;
SET refRequest.Parameter[1] = MQCA_Q_NAME;
SET refRequest.Parameter[1].* = 'TEST2';
-- SET refRequest.Parameter[2] = MQIACF_Q_ATTRS;
-- SET refRequest.Parameter[2].*[1] = MQIA_CURRENT_Q_DEPTH;
set OutputRoot.BLOB.BLOB = asbitstream(OutputRoot.MQPCF);
set OutputRoot.MQPCF = null;
set OutputRoot.MQRFH2 = null;
SET OutputRoot.MQMD.Format = MQFMT_ADMIN;
RETURN TRUE; |
All good and well. But, say I only want to return the queue depth...how do I do that? I played around a bit with it, no luck so far, I keep getting back in msg 1:
Code: |
00000000 02000000 24000000 01000000 0D000000
00000016 01000000 00000000 02000000 C60B0000
00000032 01000000 03000000 10000000 F4030000
00000048 EA030000 |
and in msg 2
Code: |
00000000 02000000 24000000 01000000 0D000000
00000016 02000000 01000000 02000000 C00B0000
00000032 00000000 |
I think the above means that:
BC6 = CFIN_PARM_ID_ERROR
3F4 = PARAMETER_ID
3EA = QUEUE_ATTRS
BC0 = COMMAND_FAILED
but, how to fix.....? Please, any help will be appreciated. Thanks
The code I add to try and only get the depth back are several variations on:
Code: |
SET refRequest.Parameter[2] = MQIACF_Q_ATTRS;
SET refRequest.Parameter[2].*[1] = MQIA_CURRENT_Q_DEPTH; |
_________________ If you do not know the answer or you get the urge to answer with "RTFM" or "Search better in this forum", please refrain from doing so, just move on to the next question. Much appreciated.
Francois van der Merwe |
|
Back to top |
|
 |
dirac |
Posted: Tue May 27, 2008 12:05 am Post subject: |
|
|
Novice
Joined: 31 Mar 2005 Posts: 23
|
SET refRequest.Parameter[1] = MQCA_Q_NAME;
SET refRequest.Parameter[1].* = 'TEST2';
SET refRequest.ParameterList[1] = MQIACF_Q_ATTRS;
SET refRequest.ParameterList[1].* = MQIA_CURRENT_Q_DEPTH; |
|
Back to top |
|
 |
francoisvdm |
Posted: Wed May 28, 2008 12:18 am Post subject: |
|
|
Partisan
Joined: 09 Aug 2001 Posts: 332
|
Thanks dirac, that did the trick.
For interested people, I parsed the PCF message coming back as follows, works great:
Code: |
CREATE LASTCHILD OF OutputRoot DOMAIN('MQPCF')
PARSE(InputRoot.BLOB.BLOB, InputRoot.MQMD.Encoding,InputRoot.MQMD.CodedCharSetId); |
_________________ If you do not know the answer or you get the urge to answer with "RTFM" or "Search better in this forum", please refrain from doing so, just move on to the next question. Much appreciated.
Francois van der Merwe |
|
Back to top |
|
 |
EKhalil |
Posted: Thu Jul 24, 2008 4:55 am Post subject: Need help issuing PCFs from WMB 6101 utilizing ESQL |
|
|
Voyager
Joined: 29 Apr 2003 Posts: 99 Location: Boston, MA
|
Input message is put on a q via WMQ Explorer on Win platform 'Put Test Message' (no additional headers)(going to linux box)
"...CALL CopyMessageHeaders();
-- CALL CopyEntireMessage();
SET OutputRoot.MQMD.MsgType = MQMT_REQUEST;
SET OutputRoot.MQMD.Format = MQFMT_ADMIN;
SET OutputRoot.MQMD.CodedCharSetId = 1208; --MQCCSI_Q_MGR;--819
SET OutputRoot.MQMD.Encoding = 801; --MQENC_NATIVE; --273;
SET OutputRoot.MQMD.ReplyToQ = 'EVA.TEST.OUT.Q';
SET OutputRoot.MQMD.ReplyToQMgr = ' ';
SET OutputRoot.MQPCF.Type = 1; --MQCFT_COMMAND; --1
SET OutputRoot.MQPCF.Version = MQCFH_CURRENT_VERSION;
SET OutputRoot.MQPCF.StrucLength = 36; --MQCFH_STRUC_LENGTH;
SET OutputRoot.MQPCF.Command = MQCMD_INQUIRE_Q;
SET OutputRoot.MQPCF.MsgSeqNumber = 1;
SET OutputRoot.MQPCF.Control = 1; --MQCFC_LAST;
SET OutputRoot.MQPCF.Parameter[1] = MQCA_Q_NAME;
SET OutputRoot.MQPCF.Parameter[1].* = 'EVA.TEST.IN.Q';
--SET OutputRoot.MQPCF.ParameterList[1] = MQIACF_ALL;
SET OutputRoot.MQPCF.ParameterList[1] = MQIACF_Q_ATTRS;
SET OutputRoot.MQPCF.ParameterList[1].* = MQIA_CURRENT_Q_DEPTH;
SET OutputRoot.BLOB.BLOB = ASBITSTREAM(OutputRoot.MQPCF);
SET OutputRoot.MQPCF = NULL;..."
When MQPCF.StrucLength is set I am having parser issues:
...BIP2488E: Error detected whilst executing the SQL statement 'SET OutputRoot.BLOB.BLOB = ASBITSTREAM(OutputRoot.MQPCF
)...
BIPP5912W: Error in parser 'MQPCF' whilst writing the field named 'StrucLength' to the bitstream.
BIP6121E: Command and Response not valid for Type field of a parameter...
... /build/S610_P/src/DataFlowEngine/ImbMqPcf
Parser.cpp: 1766: ImbMqpcfParser::appendParameterToString: ...
When MQPCF.StrucLength is omitted my message ends up in a dead letter q with MQRC 2237:
PCF integer parameter structure not valid.
On an MQPUT or MQPUT1 call, the PCF integer parameter structure MQCFIN in the message data is not valid.
Corrective action: Correct the definition of the MQCFIN structure. Ensure that the fields are set correctly...
Does anyone see what I'm doing wrong ??? |
|
Back to top |
|
 |
EKhalil |
Posted: Thu Jul 24, 2008 10:01 am Post subject: still no luck |
|
|
Voyager
Joined: 29 Apr 2003 Posts: 99 Location: Boston, MA
|
I've been manipulating headers to no avail...I either get parser errors or MQRC 2237 or 3023...
Has anyone successfully issued PFCs from the WMB6.1 Linux broker to 6.0 Linux Qmgr (message originates on Win Client) ??? |
|
Back to top |
|
 |
dirac |
Posted: Fri Jul 25, 2008 1:53 am Post subject: |
|
|
Novice
Joined: 31 Mar 2005 Posts: 23
|
You don't need to bother with StrucLength - the broker will calculate it for you. If you try to specify it you will get an error though in more recent code levels any attempt to set it will be ignored.
I've not tried your Win-Linux example but I can get your message to work on my Windows box.
I have a compute node with the ESQL of
EVAL(InputRoot.XMLNSC.Data.TryProgram);
I pass an XMLNSC message in of:
<Data>
<TryProgram>
CREATE NEXTSIBLING OF OutputRoot.Properties DOMAIN 'MQMD';
CREATE NEXTSIBLING OF OutputRoot.MQMD DOMAIN 'MQADMIN'
NAME 'MQPCF';
CREATE FIELD OutputRoot.MQPCF;
SET OutputRoot.MQMD.MsgType = MQMT_REQUEST;
Set OutputRoot.MQMD.ReplyToQ = 'COMMAND.FLOW1.RESPONSE';
SET OutputRoot.MQMD.CodedCharSetId = 1208;
SET OutputRoot.MQMD.Encoding = 801;
DECLARE refRequest REFERENCE TO OutputRoot.MQPCF;
SET refRequest.Type = 1;
SET refRequest.StrucLength = MQCFH_STRUC_LENGTH;
SET refRequest.Version = MQCFH_CURRENT_VERSION;
Set refRequest.Command = MQCMD_INQUIRE_Q;
SET refRequest.MsgSeqNumber = 1;
SET refRequest.Control = 1;
SET refRequest.Parameter[1] = MQCA_Q_NAME;
SET refRequest.Parameter[1].* = 'OUT';
SET refRequest.ParameterList[1] = MQIACF_Q_ATTRS;
SET refRequest.ParameterList[1].* = MQIA_CURRENT_Q_DEPTH;
</TryProgram>
</Data>
Change it for your queue names and see if you have any luck. |
|
Back to top |
|
 |
EKhalil |
Posted: Fri Jul 25, 2008 5:51 am Post subject: Still not working... |
|
|
Voyager
Joined: 29 Apr 2003 Posts: 99 Location: Boston, MA
|
Thanks for response I have tried your code but still getting stuck...parser chocking on struc length. Opened a PMR will update this with solution...
Eva |
|
Back to top |
|
 |
EKhalil |
Posted: Wed Jul 30, 2008 5:31 am Post subject: IBM has a patch for this now |
|
|
Voyager
Joined: 29 Apr 2003 Posts: 99 Location: Boston, MA
|
K, so there is a patch from IBM for the temperamental PCF parser... |
|
Back to top |
|
 |
|