Author |
Message
|
suri |
Posted: Wed Jun 09, 2004 4:41 pm Post subject: how to send/receive .pdf files through JMS |
|
|
Apprentice
Joined: 16 May 2004 Posts: 39 Location: NewYork
|
Hi
My requirement is, I am getting data in XML stream. Inside the XML stream will be a .pdf file. This XML stream needs to be retrieved from the Queue and stored in to database.
Can any one help me the best method to proceed.
Thanks in advance |
|
Back to top |
|
 |
bduncan |
Posted: Thu Jun 10, 2004 10:31 am Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
First off, what do you mean "XML stream" ??? MQSeries doesn't support streaming. It is an asynchronous messaging system.
Second, why should MQSeries care if it is a PDF or any other type of file? The queue manager simply treats it as a bunch of bytes that get packaged into a message.
Now, assuming that messages are arriving on a queue, and those messages contain a bunch of bytes that represent a PDF file, you can write an application that simply gets the message from the queue, and assuming you have a BLOB column type in your database, take the byte array and insert it. It's as simple as that. _________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
Back to top |
|
 |
exp |
Posted: Thu Jun 10, 2004 11:26 am Post subject: |
|
|
Newbie
Joined: 13 May 2004 Posts: 9
|
First option:
Don't use xml at all.
Simply read the pdf into a byte array and send it using the JMS BytesMessage.
On the receiving end you can save the byte array as BLOB.
//
Second option:
Encode each byte of the pdf file as 2 chars (a hex representation).
Then pass the resulting string in some xml element
<tag>********************</tag>
using the body of a JMS TextMessage.
On the receiving end you decode it and save in a BLOB.
The problem with this method is that you actually double the size
of the transmitted file. Also you add data processing.
But, if you insist on xml ...
//
I think the first option is preferrable - but it's your choise. |
|
Back to top |
|
 |
suri |
Posted: Thu Jun 10, 2004 11:34 am Post subject: |
|
|
Apprentice
Joined: 16 May 2004 Posts: 39 Location: NewYork
|
Hi bduncan
Thanks a lot,
Could you please tell me sample program to retrieve data from the Qmanager and inserting into database(SQL).
Thanks |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jun 10, 2004 11:38 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
suri wrote: |
Could you please tell me sample program to retrieve data from the Qmanager and inserting into database(SQL).
|
Have you looked at the available sample programs first?
Why not?
Have you searched here for "sample program"?
Why not? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
suri |
Posted: Thu Jun 10, 2004 11:42 am Post subject: |
|
|
Apprentice
Joined: 16 May 2004 Posts: 39 Location: NewYork
|
Hi
All applications submitted online will be saved in an xml stream of data. This XML stream needs to be retrieved from the MQ Series and processed.
Thanks. |
|
Back to top |
|
 |
bduncan |
Posted: Thu Jun 10, 2004 5:57 pm Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
Quote: |
All applications submitted online will be saved in an xml stream of data. This XML stream needs to be retrieved from the MQ Series and processed. |
Perhaps I'm not understanding you, but the above statement worries me. I'm not sure if you understand what MQSeries does. When you say applications (which I'm assuming are the PDFs) are submitted, they "will be saved in an xml stream" Where does this stream go? What sort of stream is it? What protocol is it using? And when you say "this XML stream needs to be retrieved from the MQ Series", I have to ask you, how is the XML stream getting translated into MQSeries messages which get placed on a queue in the first place? _________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
Back to top |
|
 |
suri |
Posted: Mon Jun 14, 2004 4:25 am Post subject: |
|
|
Apprentice
Joined: 16 May 2004 Posts: 39 Location: NewYork
|
Hi,
Thank you for your response.
I am also bit of confusion, actually the task I have to perform is
# Read messages from the MQ(request queue)
# Send status to MQ(Response Queue)
# Parse the xml and download the PDF
# Send the PDF to a printer
# Load the PDF into database.
This xml is in BLOB, pl.let me know how to proceed.
Thanks |
|
Back to top |
|
 |
manoj |
Posted: Mon Jun 14, 2004 5:45 am Post subject: |
|
|
 Master
Joined: 30 Jan 2002 Posts: 237 Location: Virgina
|
By XML Stream do you mean the form data submitted from your online application is in the form of XML ?
From the order you have specified i could see that you want to send this XML to an MQ queue...an application listening to that queue will parse the XML and generate the PDF ..also will insert the PDF in to BLOB...
I don't understand why do you want to send the PDF? _________________ -manoj |
|
Back to top |
|
 |
suri |
Posted: Mon Jun 14, 2004 7:21 am Post subject: |
|
|
Apprentice
Joined: 16 May 2004 Posts: 39 Location: NewYork
|
manoj
Inside the XML stream will be a .PDF file that mimics the current application, all data fields entered into the online form will also included in this XML stream of data. This I need to be retrieved from the queue.
Thanks |
|
Back to top |
|
 |
|