|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
JavaCompute to MQOutput node : Same message repeated. |
« View previous topic :: View next topic » |
Author |
Message
|
Cogito-Ergo-Sum |
Posted: Fri Dec 24, 2010 3:45 am Post subject: JavaCompute to MQOutput node : Same message repeated. |
|
|
 Master
Joined: 07 Feb 2006 Posts: 293 Location: Bengaluru, India
|
In my experiment with JavaCompute node, I am trying to write the elements of a String array into MQOutput node. While the number of messages is equal to the length of the array, it is the only the first element - repeated as many times as the length of the array - that is written. I have gone through various sections of the documentation but, unable to point out the error. Can you please guide me ?
Code: |
public void evaluate(MbMessageAssembly contact admin) throws MbException {
MbOutputTerminal out = getOutputTerminal("out");
MbOutputTerminal alt = getOutputTerminal("alternate");
MbMessage inMessage = contact admin.getMessage();
MbMessage outMessage = new MbMessage();
MbMessageAssembly outAssembly = new MbMessageAssembly(contact admin,outMessage);
try {
copyMessageHeaders(inMessage, outMessage);
MbElement outRoot, outParser, outBody ;
String dataArray[] = {"A","B","C","D","E","F"} ;
for (int i = 0 ; i<dataArray.length; i++) {
outRoot = outMessage.getRootElement();
outParser = outRoot.createElementAsLastChild(MbBLOB.PARSER_NAME);
outBody = outParser.createElementAsLastChild(MbElement.TYPE_NAME_VALUE, "BLOB", dataArray[i].getBytes());
out.propagate(outAssembly);
}
} finally {
outMessage.clearMessage();
}
}
|
_________________ ALL opinions are welcome.
-----------------------------
Debugging tip:When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
---Sherlock Holmes |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Dec 24, 2010 5:04 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
The only legal, serialized child of the BLOB domain is the first BLOB element.
You can only have OutputRoot.BLOB.BLOB.
So that's why you're only getting the first one.
Why it's coming out as the full length of the array, I don't know - presumably this is something wonky with Java and getBytes() - you might try (dataArray[i]).getBytes() to ensure that you're running getBytes on the right thing. |
|
Back to top |
|
 |
Cogito-Ergo-Sum |
Posted: Fri Dec 24, 2010 7:04 am Post subject: |
|
|
 Master
Joined: 07 Feb 2006 Posts: 293 Location: Bengaluru, India
|
Quote: |
The only legal, serialized child of the BLOB domain is the first BLOB element.
You can only have OutputRoot.BLOB.BLOB.
So that's why you're only getting the first one. |
If that is true, then how come the same code is able to write out to an output file - via a FileOutput node - correctly ? I had the Out terminal of JavaCompute connected to a MQOutput node (call it, MO01) and also a FileOutput node (call it, FO01). FO01 writes out to a file correctly whereas MO01 has 6 messages with 'A' for all 6 messages.
Here is another surprising part. Because the same code is writing to FO01 correctly, I connected the Out of FO01 to another MQOutput node (MO02). The same issue with MO01 is seen with MO02 as well !
Quote: |
Why it's coming out as the full length of the array, I don't know - presumably this is something wonky with Java and getBytes() - you might try (dataArray[i]).getBytes() to ensure that you're running getBytes on the right thing. |
Tried; no difference. _________________ ALL opinions are welcome.
-----------------------------
Debugging tip:When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
---Sherlock Holmes |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Dec 24, 2010 7:49 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Okay, reading your code again, it's doing something different than I thought it did at first glance before the coffee had kicked in.
You're not trying to create OutputRoot.BLOB.BLOB[6], you're propagating separate messages, each with only one OutputRoot.BLOB.BLOB.
But your code is still adding a new BLOB child and a new BLOB domain each time through the loop.
Code: |
copyMessageHeaders(inMessage, outMessage);
MbElement outRoot, outParser, outBody ;
String dataArray[] = {"A","B","C","D","E","F"} ;
outRoot = outMessage.getRootElement();
outParser = outRoot.createElementAsLastChild(MbBLOB.PARSER_NAME);
outBody = outParser.createElementAsLastChild(MbElement.TYPE_NAME_VALUE, "BLOB", " ");
for (int i = 0 ; i<dataArray.length; i++) {
outBody.setValue(dataArray[i].getBytes());
out.propagate(outAssembly);
} |
|
|
Back to top |
|
 |
mqjeff |
Posted: Fri Dec 24, 2010 7:50 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
And, again, you *really* need to get in the habit of adding a Trace node after your JavaCompute node, and set it to show you ${Root}.
This way you will *know* what your code is producing, rather than trying to guess based on how the logical message tree is serialized. |
|
Back to top |
|
 |
mgk |
Posted: Fri Dec 24, 2010 8:04 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Quote: |
You can only have OutputRoot.BLOB.BLOB |
Actually the BLOB parser can have multiple folders all called BLOB (each with their own BLOB data), and the BLOB parser will automatically concatenate them together for you before producing a single bitstream containing all the data. This means you do not have to concatenate multiple BLOBS together yourself, you can let the parser do it for you which is more efficient..
e.g.
Code: |
SET OutputRoot.BLOB.BLOB[1] = X'AABB';
SET OutputRoot.BLOB.BLOB[2] = X'CCDD';
SET OutputRoot.BLOB.BLOB[3] = X'EEFF'; |
Produces a single bitstream containing X'AABBCCDDEEFF'
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 |
|
 |
Cogito-Ergo-Sum |
Posted: Fri Dec 24, 2010 9:07 am Post subject: |
|
|
 Master
Joined: 07 Feb 2006 Posts: 293 Location: Bengaluru, India
|
Quote: |
You're not trying to create OutputRoot.BLOB.BLOB[6], you're propagating separate messages, each with only one OutputRoot.BLOB.BLOB. |
But, the file gets written correctly in this scheme.
Quote: |
And, again, you *really* need to get in the habit of adding a Trace node after your JavaCompute node, and set it to show you ${Root}. |
Yes. I am setting it up now.  _________________ ALL opinions are welcome.
-----------------------------
Debugging tip:When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
---Sherlock Holmes |
|
Back to top |
|
 |
Cogito-Ergo-Sum |
Posted: Fri Dec 24, 2010 10:41 am Post subject: |
|
|
 Master
Joined: 07 Feb 2006 Posts: 293 Location: Bengaluru, India
|
Quote: |
Actually the BLOB parser can have multiple folders all called BLOB (each with their own BLOB data), and the BLOB parser will automatically concatenate them together for you before producing a single bitstream containing all the data. This means you do not have to concatenate multiple BLOBS together yourself, you can let the parser do it for you which is more efficient.. |
Maybe, this is the reason why it "worked" in case of files. The output file size is 12 bytes for 6 characters of 1 byte each. Each of the BLOB folders were concatenated and was directed to the file. But, since the FileOutput node had the record definition as 'Record is Delimited Data' and Delimiter as 'Broker System Line End' the newline character was padded to each character; confirmed in a Hex viewer. This made the size to 12 bytes. _________________ ALL opinions are welcome.
-----------------------------
Debugging tip:When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
---Sherlock Holmes |
|
Back to top |
|
 |
Cogito-Ergo-Sum |
Posted: Fri Dec 24, 2010 11:11 am Post subject: |
|
|
 Master
Joined: 07 Feb 2006 Posts: 293 Location: Bengaluru, India
|
Here is a portion of the trace output. The messages keep getting appended at the 'end' with the firstChild always being 'A'. I did some trial and error with createElementAsFirstChild but didn't have luck. I will think of something else tomorrow morning.
Code: |
( ['MQROOT' : 0x8b85570]
(0x01000000):Properties = ( ['MQPROPERTYPARSER' : 0x8dcd510]
(0x03000000):MessageSet = '' (CHARACTER)
(0x03000000):MessageType = '' (CHARACTER)
(0x03000000):MessageFormat = '' (CHARACTER)
(0x03000000):Encoding = 546 (INTEGER)
(0x03000000):CodedCharSetId = 1208 (INTEGER)
(0x03000000):Transactional = TRUE (BOOLEAN)
(0x03000000):Persistence = FALSE (BOOLEAN)
(0x03000000):CreationTime = GMTTIMESTAMP '2010-12-24 18:59:09.350' (GMTTIMESTAMP)
(0x03000000):ExpirationTime = -1 (INTEGER)
(0x03000000):Priority = 0 (INTEGER)
(0x03000000):ReplyIdentifier = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000):ReplyProtocol = 'MQ' (CHARACTER)
(0x03000000):Topic = NULL
(0x03000000):ContentType = '' (CHARACTER)
(0x03000000):IdentitySourceType = '' (CHARACTER)
(0x03000000):IdentitySourceToken = '' (CHARACTER)
(0x03000000):IdentitySourcePassword = '' (CHARACTER)
(0x03000000):IdentitySourceIssuedBy = '' (CHARACTER)
(0x03000000):IdentityMappedType = '' (CHARACTER)
(0x03000000):IdentityMappedToken = '' (CHARACTER)
(0x03000000):IdentityMappedPassword = '' (CHARACTER)
(0x03000000):IdentityMappedIssuedBy = '' (CHARACTER)
)
(0x01000000):MQMD = ( ['MQHMD' : 0x8d257a0]
(0x03000000):SourceQueue = 'HOST.QM01.QL001.ACTN' (CHARACTER)
(0x03000000):Transactional = TRUE (BOOLEAN)
(0x03000000):Encoding = 546 (INTEGER)
(0x03000000):CodedCharSetId = 1208 (INTEGER)
(0x03000000):Format = 'MQSTR ' (CHARACTER)
(0x03000000):Version = 2 (INTEGER)
(0x03000000):Report = 0 (INTEGER)
(0x03000000):MsgType = 8 (INTEGER)
(0x03000000):Expiry = -1 (INTEGER)
(0x03000000):Feedback = 0 (INTEGER)
(0x03000000):Priority = 0 (INTEGER)
(0x03000000):Persistence = 0 (INTEGER)
(0x03000000):MsgId = X'414d51204e5355425241484d2e514d30c2b0144d02c10220' (BLOB)
(0x03000000):CorrelId = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000):BackoutCount = 0 (INTEGER)
(0x03000000):ReplyToQ = ' ' (CHARACTER)
(0x03000000):ReplyToQMgr = 'HOST.QM01 ' (CHARACTER)
(0x03000000):UserIdentifier = 'mqm ' (CHARACTER)
(0x03000000):AccountingToken = X'0431303036000000000000000000000000000000000000000000000000000006' (BLOB)
(0x03000000):ApplIdentityData = ' ' (CHARACTER)
(0x03000000):PutApplType = 6 (INTEGER)
(0x03000000):PutApplName = 'eclipse ' (CHARACTER)
(0x03000000):PutDate = DATE '2010-12-24' (DATE)
(0x03000000):PutTime = GMTTIME '18:59:09.350' (GMTTIME)
(0x03000000):ApplOriginData = ' ' (CHARACTER)
(0x03000000):GroupId = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000):MsgSeqNumber = 1 (INTEGER)
(0x03000000):Offset = 0 (INTEGER)
(0x03000000):MsgFlags = 0 (INTEGER)
(0x03000000):OriginalLength = -1 (INTEGER)
)
(0x01000000):BLOB = ( ['none' : 0x8de0098]
(0x03000000):BLOB = X'41' (BLOB)
)
(0x01000000):BLOB = ( ['none' : 0x8b97e28]
(0x03000000):BLOB = X'42' (BLOB)
)
(0x01000000):BLOB = ( ['none' : 0x8b9b6c0]
(0x03000000):BLOB = X'43' (BLOB)
)
)
( ['MQROOT' : 0x8b85570]
(0x01000000):Properties = ( ['MQPROPERTYPARSER' : 0x8dcd510]
(0x03000000):MessageSet = '' (CHARACTER)
(0x03000000):MessageType = '' (CHARACTER)
(0x03000000):MessageFormat = '' (CHARACTER)
(0x03000000):Encoding = 546 (INTEGER)
(0x03000000):CodedCharSetId = 1208 (INTEGER)
(0x03000000):Transactional = TRUE (BOOLEAN)
(0x03000000):Persistence = FALSE (BOOLEAN)
(0x03000000):CreationTime = GMTTIMESTAMP '2010-12-24 18:59:09.350' (GMTTIMESTAMP)
(0x03000000):ExpirationTime = -1 (INTEGER)
(0x03000000):Priority = 0 (INTEGER)
(0x03000000):ReplyIdentifier = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000):ReplyProtocol = 'MQ' (CHARACTER)
(0x03000000):Topic = NULL
(0x03000000):ContentType = '' (CHARACTER)
(0x03000000):IdentitySourceType = '' (CHARACTER)
(0x03000000):IdentitySourceToken = '' (CHARACTER)
(0x03000000):IdentitySourcePassword = '' (CHARACTER)
(0x03000000):IdentitySourceIssuedBy = '' (CHARACTER)
(0x03000000):IdentityMappedType = '' (CHARACTER)
(0x03000000):IdentityMappedToken = '' (CHARACTER)
(0x03000000):IdentityMappedPassword = '' (CHARACTER)
(0x03000000):IdentityMappedIssuedBy = '' (CHARACTER)
)
(0x01000000):MQMD = ( ['MQHMD' : 0x8d257a0]
(0x03000000):SourceQueue = 'HOST.QM01.QL001.ACTN' (CHARACTER)
(0x03000000):Transactional = TRUE (BOOLEAN)
(0x03000000):Encoding = 546 (INTEGER)
(0x03000000):CodedCharSetId = 1208 (INTEGER)
(0x03000000):Format = 'MQSTR ' (CHARACTER)
(0x03000000):Version = 2 (INTEGER)
(0x03000000):Report = 0 (INTEGER)
(0x03000000):MsgType = 8 (INTEGER)
(0x03000000):Expiry = -1 (INTEGER)
(0x03000000):Feedback = 0 (INTEGER)
(0x03000000):Priority = 0 (INTEGER)
(0x03000000):Persistence = 0 (INTEGER)
(0x03000000):MsgId = X'414d51204e5355425241484d2e514d30c2b0144d02c10220' (BLOB)
(0x03000000):CorrelId = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000):BackoutCount = 0 (INTEGER)
(0x03000000):ReplyToQ = ' ' (CHARACTER)
(0x03000000):ReplyToQMgr = 'HOST.QM01 ' (CHARACTER)
(0x03000000):UserIdentifier = 'mqm ' (CHARACTER)
(0x03000000):AccountingToken = X'0431303036000000000000000000000000000000000000000000000000000006' (BLOB)
(0x03000000):ApplIdentityData = ' ' (CHARACTER)
(0x03000000):PutApplType = 6 (INTEGER)
(0x03000000):PutApplName = 'eclipse ' (CHARACTER)
(0x03000000):PutDate = DATE '2010-12-24' (DATE)
(0x03000000):PutTime = GMTTIME '18:59:09.350' (GMTTIME)
(0x03000000):ApplOriginData = ' ' (CHARACTER)
(0x03000000):GroupId = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000):MsgSeqNumber = 1 (INTEGER)
(0x03000000):Offset = 0 (INTEGER)
(0x03000000):MsgFlags = 0 (INTEGER)
(0x03000000):OriginalLength = -1 (INTEGER)
)
(0x01000000):BLOB = ( ['none' : 0x8de0098]
(0x03000000):BLOB = X'41' (BLOB)
)
(0x01000000):BLOB = ( ['none' : 0x8b97e28]
(0x03000000):BLOB = X'42' (BLOB)
)
(0x01000000):BLOB = ( ['none' : 0x8b9b6c0]
(0x03000000):BLOB = X'43' (BLOB)
)
(0x01000000):BLOB = ( ['none' : 0x8d1a5a8]
(0x03000000):BLOB = X'44' (BLOB)
)
)
|
_________________ ALL opinions are welcome.
-----------------------------
Debugging tip:When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
---Sherlock Holmes |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Dec 24, 2010 11:21 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
That can't be the from the code I posted. |
|
Back to top |
|
 |
Cogito-Ergo-Sum |
Posted: Fri Dec 24, 2010 8:53 pm Post subject: |
|
|
 Master
Joined: 07 Feb 2006 Posts: 293 Location: Bengaluru, India
|
Yes, the trace is not from the code you posted. I have pasted a portion of trace for the code that you have posted and the tree seen is as expected. But surprisingly, the queue still has 'A' message replicated 6 times. In other words, the issue still remains.
Code: |
( ['MQROOT' : 0xa185328]
(0x01000000):Properties = ( ['MQPROPERTYPARSER' : 0xa183540]
(0x03000000):MessageSet = '' (CHARACTER)
(0x03000000):MessageType = '' (CHARACTER)
(0x03000000):MessageFormat = '' (CHARACTER)
(0x03000000):Encoding = 546 (INTEGER)
(0x03000000):CodedCharSetId = 1208 (INTEGER)
(0x03000000):Transactional = TRUE (BOOLEAN)
(0x03000000):Persistence = FALSE (BOOLEAN)
(0x03000000):CreationTime = GMTTIMESTAMP '2010-12-25 04:41:39.080' (GMTTIMESTAMP)
(0x03000000):ExpirationTime = -1 (INTEGER)
(0x03000000):Priority = 0 (INTEGER)
(0x03000000):ReplyIdentifier = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000):ReplyProtocol = 'MQ' (CHARACTER)
(0x03000000):Topic = NULL
(0x03000000):ContentType = '' (CHARACTER)
(0x03000000):IdentitySourceType = '' (CHARACTER)
(0x03000000):IdentitySourceToken = '' (CHARACTER)
(0x03000000):IdentitySourcePassword = '' (CHARACTER)
(0x03000000):IdentitySourceIssuedBy = '' (CHARACTER)
(0x03000000):IdentityMappedType = '' (CHARACTER)
(0x03000000):IdentityMappedToken = '' (CHARACTER)
(0x03000000):IdentityMappedPassword = '' (CHARACTER)
(0x03000000):IdentityMappedIssuedBy = '' (CHARACTER)
)
(0x01000000):MQMD = ( ['MQHMD' : 0xa27d238]
(0x03000000):SourceQueue = 'HOST.QM01.QL001.ACTN' (CHARACTER)
(0x03000000):Transactional = TRUE (BOOLEAN)
(0x03000000):Encoding = 546 (INTEGER)
(0x03000000):CodedCharSetId = 1208 (INTEGER)
(0x03000000):Format = 'MQSTR ' (CHARACTER)
(0x03000000):Version = 2 (INTEGER)
(0x03000000):Report = 0 (INTEGER)
(0x03000000):MsgType = 8 (INTEGER)
(0x03000000):Expiry = -1 (INTEGER)
(0x03000000):Feedback = 0 (INTEGER)
(0x03000000):Priority = 0 (INTEGER)
(0x03000000):Persistence = 0 (INTEGER)
(0x03000000):MsgId = X'414d51204e5355425241484d2e514d304b6c154d02770020' (BLOB)
(0x03000000):CorrelId = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000):BackoutCount = 0 (INTEGER)
(0x03000000):ReplyToQ = ' ' (CHARACTER)
(0x03000000):ReplyToQMgr = 'HOST.QM01 ' (CHARACTER)
(0x03000000):UserIdentifier = 'mqm ' (CHARACTER)
(0x03000000):AccountingToken = X'0431303036000000000000000000000000000000000000000000000000000006' (BLOB)
(0x03000000):ApplIdentityData = ' ' (CHARACTER)
(0x03000000):PutApplType = 6 (INTEGER)
(0x03000000):PutApplName = 'eclipse ' (CHARACTER)
(0x03000000):PutDate = DATE '2010-12-25' (DATE)
(0x03000000):PutTime = GMTTIME '04:41:39.080' (GMTTIME)
(0x03000000):ApplOriginData = ' ' (CHARACTER)
(0x03000000):GroupId = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000):MsgSeqNumber = 1 (INTEGER)
(0x03000000):Offset = 0 (INTEGER)
(0x03000000):MsgFlags = 0 (INTEGER)
(0x03000000):OriginalLength = -1 (INTEGER)
)
(0x01000000):BLOB = ( ['none' : 0xa27d4a8]
(0x03000000):BLOB = X'44' (BLOB)
)
)
( ['MQROOT' : 0xa185328]
(0x01000000):Properties = ( ['MQPROPERTYPARSER' : 0xa183540]
(0x03000000):MessageSet = '' (CHARACTER)
(0x03000000):MessageType = '' (CHARACTER)
(0x03000000):MessageFormat = '' (CHARACTER)
(0x03000000):Encoding = 546 (INTEGER)
(0x03000000):CodedCharSetId = 1208 (INTEGER)
(0x03000000):Transactional = TRUE (BOOLEAN)
(0x03000000):Persistence = FALSE (BOOLEAN)
(0x03000000):CreationTime = GMTTIMESTAMP '2010-12-25 04:41:39.080' (GMTTIMESTAMP)
(0x03000000):ExpirationTime = -1 (INTEGER)
(0x03000000):Priority = 0 (INTEGER)
(0x03000000):ReplyIdentifier = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000):ReplyProtocol = 'MQ' (CHARACTER)
(0x03000000):Topic = NULL
(0x03000000):ContentType = '' (CHARACTER)
(0x03000000):IdentitySourceType = '' (CHARACTER)
(0x03000000):IdentitySourceToken = '' (CHARACTER)
(0x03000000):IdentitySourcePassword = '' (CHARACTER)
(0x03000000):IdentitySourceIssuedBy = '' (CHARACTER)
(0x03000000):IdentityMappedType = '' (CHARACTER)
(0x03000000):IdentityMappedToken = '' (CHARACTER)
(0x03000000):IdentityMappedPassword = '' (CHARACTER)
(0x03000000):IdentityMappedIssuedBy = '' (CHARACTER)
)
(0x01000000):MQMD = ( ['MQHMD' : 0xa27d238]
(0x03000000):SourceQueue = 'HOST.QM01.QL001.ACTN' (CHARACTER)
(0x03000000):Transactional = TRUE (BOOLEAN)
(0x03000000):Encoding = 546 (INTEGER)
(0x03000000):CodedCharSetId = 1208 (INTEGER)
(0x03000000):Format = 'MQSTR ' (CHARACTER)
(0x03000000):Version = 2 (INTEGER)
(0x03000000):Report = 0 (INTEGER)
(0x03000000):MsgType = 8 (INTEGER)
(0x03000000):Expiry = -1 (INTEGER)
(0x03000000):Feedback = 0 (INTEGER)
(0x03000000):Priority = 0 (INTEGER)
(0x03000000):Persistence = 0 (INTEGER)
(0x03000000):MsgId = X'414d51204e5355425241484d2e514d304b6c154d02770020' (BLOB)
(0x03000000):CorrelId = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000):BackoutCount = 0 (INTEGER)
(0x03000000):ReplyToQ = ' ' (CHARACTER)
(0x03000000):ReplyToQMgr = 'HOST.QM01 ' (CHARACTER)
(0x03000000):UserIdentifier = 'mqm ' (CHARACTER)
(0x03000000):AccountingToken = X'0431303036000000000000000000000000000000000000000000000000000006' (BLOB)
(0x03000000):ApplIdentityData = ' ' (CHARACTER)
(0x03000000):PutApplType = 6 (INTEGER)
(0x03000000):PutApplName = 'eclipse ' (CHARACTER)
(0x03000000):PutDate = DATE '2010-12-25' (DATE)
(0x03000000):PutTime = GMTTIME '04:41:39.080' (GMTTIME)
(0x03000000):ApplOriginData = ' ' (CHARACTER)
(0x03000000):GroupId = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000):MsgSeqNumber = 1 (INTEGER)
(0x03000000):Offset = 0 (INTEGER)
(0x03000000):MsgFlags = 0 (INTEGER)
(0x03000000):OriginalLength = -1 (INTEGER)
)
(0x01000000):BLOB = ( ['none' : 0xa27d4a8]
(0x03000000):BLOB = X'45' (BLOB)
)
)
|
_________________ ALL opinions are welcome.
-----------------------------
Debugging tip:When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
---Sherlock Holmes |
|
Back to top |
|
 |
Cogito-Ergo-Sum |
Posted: Fri Dec 24, 2010 9:38 pm Post subject: |
|
|
 Master
Joined: 07 Feb 2006 Posts: 293 Location: Bengaluru, India
|
This is in reference to my earlier post:
Quote: |
Here is another surprising part. Because the same code is writing to FO01 correctly, I connected the Out of FO01 to another MQOutput node (MO02). The same issue with MO01 is seen with MO02 as well ! |
The trace node added between FO01 and MO02 nodes produces similar trace and yet only the first record from FO01 is propagated six times to MO02.
Code: |
( ['MQROOT' : 0xa190a98]
(0x01000000):Properties = ( ['MQPROPERTYPARSER' : 0xa20de30]
(0x03000000):MessageSet = '' (CHARACTER)
(0x03000000):MessageType = '' (CHARACTER)
(0x03000000):MessageFormat = '' (CHARACTER)
(0x03000000):Encoding = 546 (INTEGER)
(0x03000000):CodedCharSetId = 1208 (INTEGER)
(0x03000000):Transactional = TRUE (BOOLEAN)
(0x03000000):Persistence = FALSE (BOOLEAN)
(0x03000000):CreationTime = GMTTIMESTAMP '2010-12-25 05:15:10.440' (GMTTIMESTAMP)
(0x03000000):ExpirationTime = -1 (INTEGER)
(0x03000000):Priority = 0 (INTEGER)
(0x03000000):ReplyIdentifier = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000):ReplyProtocol = 'MQ' (CHARACTER)
(0x03000000):Topic = NULL
(0x03000000):ContentType = '' (CHARACTER)
(0x03000000):IdentitySourceType = '' (CHARACTER)
(0x03000000):IdentitySourceToken = '' (CHARACTER)
(0x03000000):IdentitySourcePassword = '' (CHARACTER)
(0x03000000):IdentitySourceIssuedBy = '' (CHARACTER)
(0x03000000):IdentityMappedType = '' (CHARACTER)
(0x03000000):IdentityMappedToken = '' (CHARACTER)
(0x03000000):IdentityMappedPassword = '' (CHARACTER)
(0x03000000):IdentityMappedIssuedBy = '' (CHARACTER)
)
(0x01000000):MQMD = ( ['MQHMD' : 0xa27d650]
(0x03000000):SourceQueue = 'HOST.QM01.QL001.ACTN' (CHARACTER)
(0x03000000):Transactional = TRUE (BOOLEAN)
(0x03000000):Encoding = 546 (INTEGER)
(0x03000000):CodedCharSetId = 1208 (INTEGER)
(0x03000000):Format = 'MQSTR ' (CHARACTER)
(0x03000000):Version = 2 (INTEGER)
(0x03000000):Report = 0 (INTEGER)
(0x03000000):MsgType = 8 (INTEGER)
(0x03000000):Expiry = -1 (INTEGER)
(0x03000000):Feedback = 0 (INTEGER)
(0x03000000):Priority = 0 (INTEGER)
(0x03000000):Persistence = 0 (INTEGER)
(0x03000000):MsgId = X'414d51204e5355425241484d2e514d304b6c154d02d10020' (BLOB)
(0x03000000):CorrelId = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000):BackoutCount = 0 (INTEGER)
(0x03000000):ReplyToQ = ' ' (CHARACTER)
(0x03000000):ReplyToQMgr = 'HOST.QM01 ' (CHARACTER)
(0x03000000):UserIdentifier = 'mqm ' (CHARACTER)
(0x03000000):AccountingToken = X'0431303036000000000000000000000000000000000000000000000000000006' (BLOB)
(0x03000000):ApplIdentityData = ' ' (CHARACTER)
(0x03000000):PutApplType = 6 (INTEGER)
(0x03000000):PutApplName = 'eclipse ' (CHARACTER)
(0x03000000):PutDate = DATE '2010-12-25' (DATE)
(0x03000000):PutTime = GMTTIME '05:15:10.440' (GMTTIME)
(0x03000000):ApplOriginData = ' ' (CHARACTER)
(0x03000000):GroupId = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000):MsgSeqNumber = 1 (INTEGER)
(0x03000000):Offset = 0 (INTEGER)
(0x03000000):MsgFlags = 0 (INTEGER)
(0x03000000):OriginalLength = -1 (INTEGER)
)
(0x01000000):BLOB = ( ['none' : 0xa22c378]
(0x03000000):BLOB = X'44' (BLOB)
)
)
( ['MQROOT' : 0xa190a98]
(0x01000000):Properties = ( ['MQPROPERTYPARSER' : 0xa20de30]
(0x03000000):MessageSet = '' (CHARACTER)
(0x03000000):MessageType = '' (CHARACTER)
(0x03000000):MessageFormat = '' (CHARACTER)
(0x03000000):Encoding = 546 (INTEGER)
(0x03000000):CodedCharSetId = 1208 (INTEGER)
(0x03000000):Transactional = TRUE (BOOLEAN)
(0x03000000):Persistence = FALSE (BOOLEAN)
(0x03000000):CreationTime = GMTTIMESTAMP '2010-12-25 05:15:10.440' (GMTTIMESTAMP)
(0x03000000):ExpirationTime = -1 (INTEGER)
(0x03000000):Priority = 0 (INTEGER)
(0x03000000):ReplyIdentifier = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000):ReplyProtocol = 'MQ' (CHARACTER)
(0x03000000):Topic = NULL
(0x03000000):ContentType = '' (CHARACTER)
(0x03000000):IdentitySourceType = '' (CHARACTER)
(0x03000000):IdentitySourceToken = '' (CHARACTER)
(0x03000000):IdentitySourcePassword = '' (CHARACTER)
(0x03000000):IdentitySourceIssuedBy = '' (CHARACTER)
(0x03000000):IdentityMappedType = '' (CHARACTER)
(0x03000000):IdentityMappedToken = '' (CHARACTER)
(0x03000000):IdentityMappedPassword = '' (CHARACTER)
(0x03000000):IdentityMappedIssuedBy = '' (CHARACTER)
)
(0x01000000):MQMD = ( ['MQHMD' : 0xa27d650]
(0x03000000):SourceQueue = 'HOST.QM01.QL001.ACTN' (CHARACTER)
(0x03000000):Transactional = TRUE (BOOLEAN)
(0x03000000):Encoding = 546 (INTEGER)
(0x03000000):CodedCharSetId = 1208 (INTEGER)
(0x03000000):Format = 'MQSTR ' (CHARACTER)
(0x03000000):Version = 2 (INTEGER)
(0x03000000):Report = 0 (INTEGER)
(0x03000000):MsgType = 8 (INTEGER)
(0x03000000):Expiry = -1 (INTEGER)
(0x03000000):Feedback = 0 (INTEGER)
(0x03000000):Priority = 0 (INTEGER)
(0x03000000):Persistence = 0 (INTEGER)
(0x03000000):MsgId = X'414d51204e5355425241484d2e514d304b6c154d02d10020' (BLOB)
(0x03000000):CorrelId = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000):BackoutCount = 0 (INTEGER)
(0x03000000):ReplyToQ = ' ' (CHARACTER)
(0x03000000):ReplyToQMgr = 'HOST.QM01 ' (CHARACTER)
(0x03000000):UserIdentifier = 'mqm ' (CHARACTER)
(0x03000000):AccountingToken = X'0431303036000000000000000000000000000000000000000000000000000006' (BLOB)
(0x03000000):ApplIdentityData = ' ' (CHARACTER)
(0x03000000):PutApplType = 6 (INTEGER)
(0x03000000):PutApplName = 'eclipse ' (CHARACTER)
(0x03000000):PutDate = DATE '2010-12-25' (DATE)
(0x03000000):PutTime = GMTTIME '05:15:10.440' (GMTTIME)
(0x03000000):ApplOriginData = ' ' (CHARACTER)
(0x03000000):GroupId = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000):MsgSeqNumber = 1 (INTEGER)
(0x03000000):Offset = 0 (INTEGER)
(0x03000000):MsgFlags = 0 (INTEGER)
(0x03000000):OriginalLength = -1 (INTEGER)
)
(0x01000000):BLOB = ( ['none' : 0xa22c378]
(0x03000000):BLOB = X'45' (BLOB)
)
)
( ['MQROOT' : 0xa190a98]
(0x01000000):Properties = ( ['MQPROPERTYPARSER' : 0xa20de30]
(0x03000000):MessageSet = '' (CHARACTER)
(0x03000000):MessageType = '' (CHARACTER)
(0x03000000):MessageFormat = '' (CHARACTER)
(0x03000000):Encoding = 546 (INTEGER)
(0x03000000):CodedCharSetId = 1208 (INTEGER)
(0x03000000):Transactional = TRUE (BOOLEAN)
(0x03000000):Persistence = FALSE (BOOLEAN)
(0x03000000):CreationTime = GMTTIMESTAMP '2010-12-25 05:15:10.440' (GMTTIMESTAMP)
(0x03000000):ExpirationTime = -1 (INTEGER)
(0x03000000):Priority = 0 (INTEGER)
(0x03000000):ReplyIdentifier = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000):ReplyProtocol = 'MQ' (CHARACTER)
(0x03000000):Topic = NULL
(0x03000000):ContentType = '' (CHARACTER)
(0x03000000):IdentitySourceType = '' (CHARACTER)
(0x03000000):IdentitySourceToken = '' (CHARACTER)
(0x03000000):IdentitySourcePassword = '' (CHARACTER)
(0x03000000):IdentitySourceIssuedBy = '' (CHARACTER)
(0x03000000):IdentityMappedType = '' (CHARACTER)
(0x03000000):IdentityMappedToken = '' (CHARACTER)
(0x03000000):IdentityMappedPassword = '' (CHARACTER)
(0x03000000):IdentityMappedIssuedBy = '' (CHARACTER)
)
(0x01000000):MQMD = ( ['MQHMD' : 0xa27d650]
(0x03000000):SourceQueue = 'HOST.QM01.QL001.ACTN' (CHARACTER)
(0x03000000):Transactional = TRUE (BOOLEAN)
(0x03000000):Encoding = 546 (INTEGER)
(0x03000000):CodedCharSetId = 1208 (INTEGER)
(0x03000000):Format = 'MQSTR ' (CHARACTER)
(0x03000000):Version = 2 (INTEGER)
(0x03000000):Report = 0 (INTEGER)
(0x03000000):MsgType = 8 (INTEGER)
(0x03000000):Expiry = -1 (INTEGER)
(0x03000000):Feedback = 0 (INTEGER)
(0x03000000):Priority = 0 (INTEGER)
(0x03000000):Persistence = 0 (INTEGER)
(0x03000000):MsgId = X'414d51204e5355425241484d2e514d304b6c154d02d10020' (BLOB)
(0x03000000):CorrelId = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000):BackoutCount = 0 (INTEGER)
(0x03000000):ReplyToQ = ' ' (CHARACTER)
(0x03000000):ReplyToQMgr = 'HOST.QM01 ' (CHARACTER)
(0x03000000):UserIdentifier = 'mqm ' (CHARACTER)
(0x03000000):AccountingToken = X'0431303036000000000000000000000000000000000000000000000000000006' (BLOB)
(0x03000000):ApplIdentityData = ' ' (CHARACTER)
(0x03000000):PutApplType = 6 (INTEGER)
(0x03000000):PutApplName = 'eclipse ' (CHARACTER)
(0x03000000):PutDate = DATE '2010-12-25' (DATE)
(0x03000000):PutTime = GMTTIME '05:15:10.440' (GMTTIME)
(0x03000000):ApplOriginData = ' ' (CHARACTER)
(0x03000000):GroupId = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000):MsgSeqNumber = 1 (INTEGER)
(0x03000000):Offset = 0 (INTEGER)
(0x03000000):MsgFlags = 0 (INTEGER)
(0x03000000):OriginalLength = -1 (INTEGER)
)
(0x01000000):BLOB = ( ['none' : 0xa22c378]
(0x03000000):BLOB = X'46' (BLOB)
)
)
|
_________________ ALL opinions are welcome.
-----------------------------
Debugging tip:When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
---Sherlock Holmes |
|
Back to top |
|
 |
optimist |
Posted: Sun Dec 26, 2010 7:19 am Post subject: You should add "finalizeMessage" |
|
|
Apprentice
Joined: 18 Nov 2010 Posts: 33
|
Before propagating on the "out" terminal, you should add finalizeMessage, as below:
String dataArray[] = {"A","B","C","D","E","F"} ;
for (int i = 0 ; i<dataArray.length; i++) {
outRoot = outMessage.getRootElement();
outParser = outRoot.createElementAsLastChild(MbBLOB.PARSER_NAME);
outBody = outParser.createElementAsLastChild(MbElement.TYPE_NAME_VALUE, "BLOB", dataArray[i].getBytes());
outMessage.finalizeMessage(MbMessage.FINALIZE_NONE);
out.propagate(outAssembly);
}
With this change, I got (WMB 7, WMQ 7) 6 messages on the queue:
A, AB, ABC, ABCD, ABCDE, ABCDEF
From WMB 7 Info Center:
"To propagate the same MbMessage object multiple times, call the finalizeMessage() method on the MBMessage object, so that any changes made to the message are reflected in the bit stream that is generated downstream of the Java node; for example:
MbMessage newMsg = new MbMessage(assembly.getMessage());
MbMessageAssembly newAssembly = new MbMessageAssembly(assembly, newMsg);
...
newMsg.finalizeMessage(MbMessage.FINALIZE_NONE);
out.propagate(newAssembly;
...
newMsg.finalizeMessage(MbMessage.FINALIZE_NONE);
out.propagate(newAssembly);"
--optimist |
|
Back to top |
|
 |
mqjeff |
Posted: Sun Dec 26, 2010 7:27 am Post subject: Re: You should add "finalizeMessage" |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
optimist wrote: |
With this change, I got (WMB 7, WMQ 7) 6 messages on the queue:
A, AB, ABC, ABCD, ABCDE, ABCDEF |
And I'm sure that's not at all what Cogito-Ergo-Sum actually wants as a result. I'm sure that Cogito-Ergo-Sum wants "A","B","C","D","E", and "F" as separate messages.
Otherwise, yes, finalizeMessage() may be of some use here. |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Dec 26, 2010 7:27 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You are not declaring a new message for each start of the loop.
The code is doing exactly what you tell it to. There is not going to be any different outcome however many ways you want to dice.
Step back and think of what you want to do and how to achieve it...
If you are still having such difficulties, maybe you need to ask for help from a more seasoned programmer.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|
|
 |
Goto page 1, 2 Next |
Page 1 of 2 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|