Author |
Message
|
vtoledoc |
Posted: Tue Oct 05, 2004 11:25 am Post subject: Wepshere Message Broker: Input Node deploy doesnt work |
|
|
Newbie
Joined: 05 Oct 2004 Posts: 1
|
We are implementing a java input node, under the following software versions:
Message Broker Toolkit: 5.0.3
Message Broker : 5.0.1.3
Agent Controller: 5.0.2
Message Queue: 5.3
S.O: Windows 2000 Professional
When we deploy the input node, with the exact code from the IBM Redbook, the propagation appears to have this error from the event viewer
(it is translated, it are not the exacts words)
Environment:
Broker name: BRK_02
Message Flow name: prueba4
Execution Group: jbustamante
Error in The event viewer
------------------------------------------
( BRK_02.jbustamante )
The ouput message doesnt contains any valid MQMD; test output node 'prueba4.MQOutput'.
The WebSphere Business Integration Message Brokers output node has received a message to be written in the WebSphere Business Integration output queue, but the message doesnt contains any MQMD valid.
This situation can be produced when an output message is not created in a proper way using a compute node.
Check the message flow to determine if the message has been created in a proper way. If it is not so, fix the problem and deploy de broker again.
/*------------------------------------------------------------------------------------------------------------------------------------------------
* CODE EXAMPLE FROM THE IBM RED BOOK "Developing Solutions in WebSphere MQ Integrator" Version 2.1
*------------------------------------------------------------------------------------------------------------------------------------------------*/
public class FILEJInputNode extends MbInputNode implements MbInputNodeInterface{
String listenDir; /* DO NOT provide a default value */
public FILEJInputNode() throws MbException
{
createOutputTerminal("out");
createOutputTerminal("failure");
createOutputTerminal("catch");
}
public int run(MbMessageAssembly assembly) throws MbException
{
try
{
File inputFile = new File(listenDir);
File[] fileArray = inputFile.listFiles();
String mystr = fileArray[0].toString();
System.out.println(new Date().toString() + "\nSaw File: " + mystr);
FileInputStream realinputFile = new FileInputStream(fileArray[0]);
int buflen = realinputFile.available();
byte[] buffer = new byte[buflen];
realinputFile.read(buffer);
realinputFile.close();
System.out.println("File Deleted: " + fileArray[0].delete());
MbMessage msg = createMessage(buffer);
MbMessageAssembly newAssembly = new MbMessageAssembly(assembly, msg);
MbOutputTerminal out = getOutputTerminal("out");
if(out != null)
out.propagate(newAssembly);
}
catch (java.lang.ArrayIndexOutOfBoundsException laiob)
{
System.out.println(new Date().toString() + "\nListen Dir is empty: " + laiob);
try { Thread.sleep(10000); } catch (java.lang.InterruptedException jlie) { System.out.println("Couldn't Sleep: " + jlie); }
return TIMEOUT;
}
catch (java.io.FileNotFoundException fnfe)
{
System.out.println("Problem creating File Input Stream: " + fnfe);
}
catch (java.io.IOException ioe)
{
System.out.println("Problem Sizing, Reading, or Closing the Real Input File: " + ioe);
}
try { Thread.sleep(10000); } catch (java.lang.InterruptedException jlie) { System.out.println("Couldn't Sleep: " + jlie); }
return SUCCESS_CONTINUE;
}
....
}
|
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Oct 05, 2004 12:12 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
It's not a problem with your java node.
It's a problem with your message flow using your node.
Your InputNode does not create an MQMD subtree in Root.
Therefore, before you can pass this message to an MQOutput node, you must create an MQMD subtree, using ESQL. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jbustamante |
Posted: Wed Oct 06, 2004 4:58 am Post subject: |
|
|
Novice
Joined: 06 Oct 2004 Posts: 11
|
Sorry, but how we can create the MQMD with ESQL?
Thanks! |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Oct 06, 2004 5:01 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
jbustamante wrote: |
Sorry, but how we can create the MQMD with ESQL?
Thanks! |
Using Create Field and Set.
You might be able to just use Set, to assign values to OutputRoot.MQMD. But it would be better to use Create Field on OutputRoot.MQMD first to assign it the MQMD parser.
I think. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jbustamante |
Posted: Wed Oct 06, 2004 9:41 am Post subject: |
|
|
Novice
Joined: 06 Oct 2004 Posts: 11
|
We used a compute node with the following code:
-----------------------------------------------------------------------------
CREATE COMPUTE MODULE prueba4_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyMessageHeaders();
SET OutputRoot.XML = InputRoot.XML;
--CALL CopyEntireMessage();
RETURN TRUE;
END;
CREATE PROCEDURE CopyMessageHeaders() BEGIN
DECLARE I INTEGER 1;
DECLARE J INTEGER CARDINALITY(InputRoot.*[]);
CREATE FIELD OutputRoot.MQMD.Transactional;
CREATE FIELD OutputRoot.MQMD.Encoding;
CREATE FIELD OutputRoot.MQMD.CodedCharSetId;
CREATE FIELD OutputRoot.MQMD.Format;
CREATE FIELD OutputRoot.MQMD.Version;
CREATE FIELD OutputRoot.MQMD.Report;
CREATE FIELD OutputRoot.MQMD.MsgType;
CREATE FIELD OutputRoot.MQMD.Expiry;
CREATE FIELD OutputRoot.MQMD.Feedback;
CREATE FIELD OutputRoot.MQMD.Priority;
CREATE FIELD OutputRoot.MQMD.Persistence;
CREATE FIELD OutputRoot.MQMD.MsgId;
CREATE FIELD OutputRoot.MQMD.CorrelId;
CREATE FIELD OutputRoot.MQMD.BackoutCount;
CREATE FIELD OutputRoot.MQMD.ReplyToQ;
CREATE FIELD OutputRoot.MQMD.ReplyToQMgr;
CREATE FIELD OutputRoot.MQMD.UserIdentifier;
CREATE FIELD OutputRoot.MQMD.GroupId;
CREATE FIELD OutputRoot.MQMD.MsgSeqNumber;
CREATE FIELD OutputRoot.MQMD.Offset;
CREATE FIELD OutputRoot.MQMD.MsgFlags;
CREATE FIELD OutputRoot.MQMD.OriginalLength;
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
SET OutputRoot.MQMD.Transactional=TRUE;
SET OutputRoot.MQMD.Encoding=546;
SET OutputRoot.MQMD.CodedCharSetId=850;
SET OutputRoot.MQMD.Format='xml ';
SET OutputRoot.MQMD.Version=2;
SET OutputRoot.MQMD.Report=0;
SET OutputRoot.MQMD.MsgType=8;
SET OutputRoot.MQMD.Expiry=-1;
SET OutputRoot.MQMD.Feedback=0;
SET OutputRoot.MQMD.Priority=0;
SET OutputRoot.MQMD.Persistence=0;
SET OutputRoot.MQMD.MsgId=X'123456789012345678901234567890123456789012345678';
SET OutputRoot.MQMD.CorrelId=X'000000000000000000000000000000000000000000000000';
SET OutputRoot.MQMD.BackoutCount=0;
SET OutputRoot.MQMD.ReplyToQ=' ';
SET OutputRoot.MQMD.ReplyToQMgr='BRKCGFMNG ';
SET OutputRoot.MQMD.UserIdentifier='jbustamante ';
SET OutputRoot.MQMD.GroupId=X'000000000000000000000000000000000000000000000000';
SET OutputRoot.MQMD.MsgSeqNumber=1;
SET OutputRoot.MQMD.Offset=0;
SET OutputRoot.MQMD.MsgFlags=0;
SET OutputRoot.MQMD.OriginalLength=-1;
--DECLARE StatementBitStream BLOB;
--DECLARE msgId CHARACTER;
--set msgId='125584545456889765867645346877123456789012345678';
--set StatementBitStream =CAST (msgId as BLOB);
--SET OutputRoot.MQMD.MsgId= StatementBitStream;
--SET OutputRoot.MQMD.CorrelId = StatementBitStream;
END;
CREATE PROCEDURE CopyEntireMessage() BEGIN
SET OutputRoot = InputRoot;
END;
END MODULE;
----------------------------------------------------------------------------------
When the message is propagate to the output node, it complains about the correlId (which is set in the compute node).
I debug de flow and i realize that when the message is inside the compute node, the correlId is setted, but when is propagate is set to none.
What I'm doing wrong?
Thanks!
(Please excuse my english) |
|
Back to top |
|
 |
kishoreraju |
Posted: Wed Oct 20, 2004 6:58 am Post subject: |
|
|
Disciple
Joined: 30 Sep 2004 Posts: 156
|
hi
we r also facing same type of problem the plugin node ia able to read the message from the file after the message propegated to the next node we r not not able to access the content of the message if u have any solution
help us to solve this problem |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Oct 20, 2004 7:20 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
In order to modify a message inside a plug-in node, you have to create a new Assembly. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kishoreraju |
Posted: Wed Oct 20, 2004 8:36 am Post subject: |
|
|
Disciple
Joined: 30 Sep 2004 Posts: 156
|
Hi,
I have created a new assembly.and the plugin node propagating the message to the next node but the problem is that i am not able access the
the message in the compute node.do u have any idea on this
The seario is like this
Plugin node is an MBinput node which picks the data from a text file
which is in XML format the input data is like this
<emp><empno>123456</empno></emp>
My plugin node is picking the data form the file and it is propagating to next node(compute node) here i am trying to access the message . I also added the MQMD header information. but iam not access the content of the message
Another problem is that the thread is not released by the Exceution group
Anyone can help me to solve this problem
Kishore Raju. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Oct 20, 2004 9:08 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
How are you attaching the text file data to the message tree?
You may have to instruct WBIMB to parse the data. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kirani |
Posted: Wed Oct 20, 2004 10:40 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
jbustamante wrote: |
CREATE FIELD OutputRoot.MQMD.Transactional;
|
This is not a valid property of MQMD header.
You can either use SET statement or CREATE FIELD statement to create MQMD header. You don't need both of them.
Also, as the previous post says, make sure you are setting/creating the MQMD fields in the original order. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
JT |
Posted: Thu Oct 21, 2004 6:39 am Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
Quote: |
SET OutputRoot.MQMD.Format='xml '; |
Also, I don't believe 'xml' is a valid value for the Format parameter. I suggest 'MQSTR'. |
|
Back to top |
|
 |
EddieA |
Posted: Thu Oct 21, 2004 8:59 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Quote: |
I don't believe 'xml' is a valid value for the Format parameter |
You can put anything you like for the Format. However, if MQSeries doesn't understand it, it won't do any conversion between code pages without an exit.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
|