ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Save input msg as BLOB and restoring it

Post new topic  Reply to topic
 Save input msg as BLOB and restoring it « View previous topic :: View next topic » 
Author Message
m.schneider
PostPosted: Thu Jul 19, 2007 6:48 am    Post subject: Save input msg as BLOB and restoring it Reply with quote

Centurion

Joined: 10 Apr 2007
Posts: 132
Location: Germany

Hi,

I'm trying to save my input msg to a database and later to retrieve it, ...

While saving I don't get any errors.

-- DB Definition MSG_BACKUP BLOB(2K)

DECLARE msgBitStream BLOB InputRoot.BLOB.BLOB;

INSERT INTO Database.tmp.MESSAGE(MSG_BACKUP)
VALUES ( msgBitStream);


When I try to read the msg from the database the msg I receive an error from the outputnode that the msg is empty

CALL CopyMessageHeaders();
DECLARE msgBitStream BLOB;

Set msgBitStream =THE ( SELECT ITEM M.MSG_BACKUP FROM Database.tmp.trademanager.MESSAGE as M);

SET OutputRoot.BLOB.BLOB = msgBitStream;

RETURN TRUE;


btw. can I see with the db2-database toll if a BLOB attribute has a value?

Does anyone know what I do wrong?
Back to top
View user's profile Send private message
m.schneider
PostPosted: Thu Jul 19, 2007 7:09 am    Post subject: Reply with quote

Centurion

Joined: 10 Apr 2007
Posts: 132
Location: Germany

InputRoot.BLOB.BLOB is already a BLOB, but if I try the following ... same results

INSERT INTO Database.tmp.MESSAGE(MSG_BACKUP)
VALUES ( InputRoot.BLOB.BLOB);
Back to top
View user's profile Send private message
dilse
PostPosted: Thu Jul 19, 2007 7:45 am    Post subject: Reply with quote

Master

Joined: 24 Jun 2004
Posts: 270

Do you see any data in tmp.MESSAGE table?
Did you check the value of InputRoot.BLOB.BLOB in debug?

Quote:
DECLARE msgBitStream BLOB InputRoot.BLOB.BLOB;

Did you check the value of msgBitStream after the above statement?

If you see data in InputRoot.BLOB.BLOB and not seeing when initialized to msgBitStream then try the following statement instead of above statement to see if it works.

Quote:
DECLARE msgBitStream BLOB CAST(InputRoot.BLOB.BLOB as BLOB);


Also check the length of the input BLOB you are getting as you declared the size in table as 2K.


Good luck...
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Jul 19, 2007 9:23 pm    Post subject: One Way to do this Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Is to declare your table (using DB2 as an example) colums for the things like Properties, MQMD, MQRFH2 & Data as BLOBs.

I have done this and it does work with a little effort on the restore side.
Convert each folder into a blob then you can be fairly sure that you can restore it correctly later on.
You will probably need a few non blob colums as well to help you on the retrieval side. For example, a flag to say that you have an MQRFH2 Header.
Date/Time is also a goo one and is some bit of parsed data from the message itself.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
m.schneider
PostPosted: Thu Jul 19, 2007 11:21 pm    Post subject: Reply with quote

Centurion

Joined: 10 Apr 2007
Posts: 132
Location: Germany

Thanks for your input

It's running, ...

DB2 shows something like COM.ibm.db2.jdbc.app.DB2Blob@32f14ec1 in the BLOB attribute.


DECLARE inCCSID INT InputRoot.Properties.CodedCharSetId;
DECLARE inEncoding INT InputRoot.Properties.Encoding;
DECLARE inMsgSet CHARACTER InputRoot.Properties.MessageSet;
DECLARE inMsgType CHARACTER InputRoot.Properties.MessageType;
DECLARE inMsgFormat CHARACTER InputRoot.Properties.MessageFormat;

DECLARE msgBitStream BLOB ASBITSTREAM(InputRoot.MRM ,inEncoding, inCCSID, inMsgSet, inMsgType, inMsgFormat);

INSERT INTO Database.tmp.MESSAGE(MSG_BACKUP)
VALUES ( msgBitStream);

I just save the data of the message
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Save input msg as BLOB and restoring it
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.