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 » Storing XML files in DB2 database

Post new topic  Reply to topic
 Storing XML files in DB2 database « View previous topic :: View next topic » 
Author Message
Bharat
PostPosted: Sat Oct 25, 2003 8:01 am    Post subject: Storing XML files in DB2 database Reply with quote

Acolyte

Joined: 14 May 2002
Posts: 61
Location: Reston, VA, USA

Hi,

I need to store input XML file that is coming in to MQSI 2.0.1 from frontends and also the response coming back from backends to the MQSI. Right now, I'm not storing the files, instead just transforming and routing them using Compute and Filter nodes.

According to the new requirement, I need to store a unique id got from input XML file in DB2 database to filter the duplicates. Usually, the response is sent back to the frontends based on the ReplyQueue name field in the MQMD. Now I need to resend the XML response file to the front ends by appending it to the request XML file if they loose the original response that was sent to them earlier. How can I do this?
Quote:

1. Can I store the entire request XML files (may be less than 1MB) in a table in DB2 database with MessageId as primarykey? If so what is the datatype that I can use? Hope the samething can be done for storing response XML file and the CorrelationId.

Quote:

2. If I store the XML file in database, does it get stored along with MQMD? If not, do I need to generate the MQMD after retieving from the database and before sending it to front ends? How can I handle this? I need MQMD to route it back to front ends.

Could you please guide me which is the most appropriate way to resolve to this issue? Can I have the sample codes to store this XML files in DB2 database and to append the response to the request XML file, after retrieving from database?

I appreciate your help.

Thanks in advance,
Bharat
Back to top
View user's profile Send private message
Bharat
PostPosted: Mon Oct 27, 2003 12:23 pm    Post subject: Reply with quote

Acolyte

Joined: 14 May 2002
Posts: 61
Location: Reston, VA, USA

Could any body provide a solution to this problem? I'm in real need of a soultion to this problem.

Thank you so much,
Bharat
Back to top
View user's profile Send private message
gabbar
PostPosted: Mon Oct 27, 2003 12:46 pm    Post subject: Reply with quote

Acolyte

Joined: 10 Dec 2002
Posts: 50

I don't know the data type in DB2 for storing a 1MB sized data. But for your problem, I'd suggest writing to the database, only those fields that you would need when you send them back to the frontend.

Design your database table to accomodate the essential fields. In your ESQL, extract the values for those fields from the incoming XML and write them to the database. All this can be done in a compute node.

When you want these fields, you can get them again using the primary key, within the compute node, build the XML and send it in your response.
Back to top
View user's profile Send private message Visit poster's website
Bharat
PostPosted: Mon Oct 27, 2003 1:19 pm    Post subject: Reply with quote

Acolyte

Joined: 14 May 2002
Posts: 61
Location: Reston, VA, USA

Gabbar,

Thanks for your response. It becomes complicated, if I start storing all the fields of input XML file as there are too many fields that are arranged in specific format of arrays. Moreover, I do get a different XML file for each transaction.

I should be able to store the entire XML file as it is and retrieve it, if required, irrespective of the content. As I just need to append the resposne XML file to it's corresponding request file irrespective of the content.
Quote:
I know how to store a field of XML file in database. But how to store the entire XML file itself in a table? The file may not be 1MB, but up to 10KB.
Quote:
If I get a duplicate input XML request from the frontends, I should check for that and drop the duplicate request. And I need to retrieve these earlier XML files and send back to them. How can I set the retrieved XML file from database to my outgoing reply message?

Quote:
While sending like that, I need to just append the entire response XML file to the request XML file. How can I do this?


Thank you so much,
Bharat
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Oct 27, 2003 1:40 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Have you looked at (for 2.01 only) the BITSTREAM function?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Bharat
PostPosted: Mon Oct 27, 2003 3:31 pm    Post subject: Reply with quote

Acolyte

Joined: 14 May 2002
Posts: 61
Location: Reston, VA, USA

Thanks Jeff for your response. I had a look at the BITSTREAM function after you suggested. The documentation is telling...
Quote:
This function is typically used in message warehouse scenarios, where the bit stream of a message needs to be stored in a database. The function returns the bit stream of the physical portion of the message, identified by the path parameter. It does not return the bit stream representing the actual syntax element identified.
I didn't get it completely.
Quote:
Does it store the entire XML file, along with MQMD? If so how can I specify that?
Quote:
What do I need to specify in path of BITSTREAM(path)?


Thank you so much,
Bharat[/quote]
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Oct 28, 2003 5:40 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

The bitstream of a message is the sequence of bytes that was contained in the body of the original message as it was on the queue.

So, the BITSTREAM function allows you to get back a string of data that represents the same thing you would have gotten if you'd used a regular MQSeries Get call, instead of using an MQInput node in MQSI.

Note that BITSTREAM is deprecated in 2.1, the ASBITSTREAM function should be used instead. But my (very limited) understanding is that 2.01 has a "correct" BITSTREAM function, and I know it doesn't have the ASBITSTREAM function.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Bharat
PostPosted: Fri Oct 31, 2003 7:30 am    Post subject: Reply with quote

Acolyte

Joined: 14 May 2002
Posts: 61
Location: Reston, VA, USA

Using BITSTREAM function of MQSI 2.0.1, can I store an XML file in DB2 database? If so, how can I use this function to store the entire message and how can I get back the same message from database at a different node?

Thank you so much,
Bharat
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Oct 31, 2003 8:03 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Bharat wrote:
Using BITSTREAM function of MQSI 2.0.1, can I store an XML file in DB2 database? If so, how can I use this function to store the entire message and how can I get back the same message from database at a different node?


To store the XML, use the BITSTREAM function and insert the results into your database.

To retrieve the data, extract it from the database. Then put it into your message and do something to cause it to be parsed. In 2.1, this is done with a ResetContentDescriptor node. I don't know how it's done in 2.0.1.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Bharat
PostPosted: Tue Nov 04, 2003 6:11 am    Post subject: Reply with quote

Acolyte

Joined: 14 May 2002
Posts: 61
Location: Reston, VA, USA

Could you please post a sample code for this?

Thank you so much,
Bharat
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Nov 04, 2003 6:23 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I can't post sample code.

I don't know what your database looks like.

I don't have access to version 2.0.1.

There should be sample code in the documentation that explains how to use the BITSTREAM function. Try the 2.01 version of the ESQL Reference manual.

The retrieval process is just a SELECT. And then stuff that I don't know how to do in your version. But probably involves using a RCD node as I said.

If you write code yourself, and are having problems with it, you can post it back here. And then someone who does know 2.01 can maybe give you hints.

But even then you'll probably have to post much more specific information about your specific environment -database structure, message structure and such.

Or of course you could hire a consultant to help you.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Bharat
PostPosted: Tue Nov 04, 2003 11:56 am    Post subject: Reply with quote

Acolyte

Joined: 14 May 2002
Posts: 61
Location: Reston, VA, USA

Thanks Jeff. The 2.0.1 ESQL referecne doesn't provide any further documentaion other than the following in regard to BITSTREAM function.
Quote:
This function is typically used in message warehouse scenarios, where the bit stream of a message needs to be stored in a database. The function returns the bit stream of the physical portion of the message, identified by the path parameter. It does not return the bit stream representing the actual syntax element identified.
I will try to use it and post back, if I see any problems.

Thanks,
Bharat
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 » Storing XML files in DB2 database
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.