|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Rebuilding a message from blob data held within Oracle |
« View previous topic :: View next topic » |
Author |
Message
|
JohnMetcalfe |
Posted: Wed Jun 30, 2004 7:12 am Post subject: Rebuilding a message from blob data held within Oracle |
|
|
 Apprentice
Joined: 02 Apr 2004 Posts: 40 Location: Edinburgh, Scotland
|
Hello all,
As part of a msg store and resend utility, I am trying to rebuild a message from the contents of several blob fields within a Oracle table. The data in these fields has been previous saved by WMQI.
The flow that this is running in will be initiated by a 'trigger' message - this contains only the msg_id of the message to resend. So in theory, all I need to do is to fetch the message data from the Oracle table and build a new message, including MQMD and RFH2, in the OutputRoot.
I'm unsure if I'm approaching the soln to the problem the correct way. The approach I'm currently working on is below:
Code: |
DECLARE mqmd BLOB;
DECLARE rfh2 BLOB;
DECLARE payload BLOB;
-- get the data, separate blob column for MQMD, RFH2,payload
SET mqmd = THE (SELECT ITEM M.mqmd FROM Database.MSGSTORE AS M WHERE M.MsgId = ??);
SET rfh2 = THE (SELECT ITEM M.rfh2 FROM Database.MSGSTORE AS M WHERE M.MsgId = ??);
SET payload = THE (SELECT ITEM M.payload FROM Database.MSGSTORE AS M WHERE M.MsgId = ??);
-- attempt to build new trees
CREATE LASTCHILD of OutputRoot DOMAIN 'MQMD' PARSE (mqmd);
CREATE LASTCHILD of OutputRoot DOMAIN 'MQRFH2' PARSE (rfh2);
CREATE LASTCHILD of OutputRoot DOMAIN 'BLOB' PARSE (payload); |
Has anybody done something similar? - am I on the right track using CREATE with the PARSE clause? - I haven't got this working yet. Any advice gratefully received.
Cheers |
|
Back to top |
|
 |
JT |
Posted: Mon Jul 12, 2004 12:42 pm Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
Were you able to make this work? |
|
Back to top |
|
 |
JohnMetcalfe |
Posted: Tue Jul 20, 2004 8:04 am Post subject: |
|
|
 Apprentice
Joined: 02 Apr 2004 Posts: 40 Location: Edinburgh, Scotland
|
The save and rebuild on the MQMD and message payload works a treat.
I'm still having problems with the RFH2 header.
When I save this to a BLOB in an Oracle table, then read this back into a blob variable in ESQL and try to rebuild the tree using the code
CREATE LASTCHILD of OutputRoot DOMAIN 'MQRFH2' PARSE (rfh2);
I get the following errors:
BIP2909E: (46, 1) : Exception throw whilst processing the CREATE statement
The CREATE statement has been unable to be completed due to an exception being thrown whilst evaluating the PARSE clause.
. Additional information available is: 'CREATE LASTCHILD OF OutputRoot DOMAIN 'MQRFH2' PARSE(rfh2);'
You Should check for other messages issued with this one for the full context of this error.
----------[2004-07-20 16:52:17.606901 4417 ParserException ]-----------------------------------------------------
BIP6118E: The remaining bitstream is too small to contain the indicated structure.
The bitstream, as presented to the 'MQHRF2' parser, is too small to contain the 'MQRFH2' structure. The lengt
h of this structure as given in the structure header is '1275133952'. The message appears to have been trunca
ted.
Check with the support group responsible for the parser in question.
To get round this, we can save the fields of the RFH2 header into separate columns on the database, but this is not ideal. We don't have much in here, mainly it is the pub/sub information (Topic), and fields held in the usr folder (about 5 of them). However, it would be much,much better for us to store this header in the same way as the MQMD.....
Anybody any suggestions on how to rebuild this RFH2 header???? |
|
Back to top |
|
 |
ACheeseman |
Posted: Tue Jul 20, 2004 1:21 pm Post subject: Possily change the coding from windows to unix |
|
|
 Novice
Joined: 25 Feb 2004 Posts: 19 Location: London UK
|
Hi Marvin,
From looking at that size it would appear that the integer values aren't being read corrected.
You have a size of 1275133952. This is hex 4C010000.
I think you need to convert from windows coding to unix.
This would give you hex. 0000014C. which is actually a size of only 332.
I like the way you've stored the information though. I hadn't thought of splitting them in such a way. |
|
Back to top |
|
 |
Marek |
Posted: Thu Jul 22, 2004 7:29 am Post subject: Solution |
|
|
Apprentice
Joined: 30 Jun 2004 Posts: 32 Location: Edinburgh
|
I have already built something very similar involving WMQI and Oracle 8i.
The explanation above by ACheeseman is the 'key' to the problem.
If you code MQENC_INTEGER_REVERSED in the RFH2 creation code logic I would suggest that the issue will be resolved.
For example:
CREATE LASTCHILD of OutputRoot DOMAIN 'MQRFH2' PARSE (rfh2blobvariable,MQENC_INTEGER_REVERSED);
Alternatively, insert the data as MQENC_INTEGER_NORMAL thereby eliminating the need to do any conversion on the way out of Oracle.
Good luck.  |
|
Back to top |
|
 |
JohnMetcalfe |
Posted: Thu Jul 22, 2004 8:21 am Post subject: |
|
|
 Apprentice
Joined: 02 Apr 2004 Posts: 40 Location: Edinburgh, Scotland
|
Marat,
Thanks for this. I used this approach and it all works a treat, the RFH2 is being rebuilt with no problems.
Thanks to all for the input. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|